Re: [R] IRT Package
In fact, there some common IRT models that ltm cannot currently handle, e.g., the three-parameter logistic model or the graded response model; however, I do plan to incorporate these models in the near future. Best, Dimitris - Original Message - From: Doran, Harold [EMAIL PROTECTED] To: Caio Lucidius Naberezny Azevedo [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Sent: Sunday, November 27, 2005 2:52 PM Subject: Re: [R] IRT Package I do not believe another IRT package exists. However, I have recently used the rasch() function in ltm for a study I am doing and have found it very useful. I'm curious (as I'm sure the ltm developer is) as to what are you doing that ltm cannot handle. Harold -Original Message- From: [EMAIL PROTECTED] on behalf of Caio Lucidius Naberezny Azevedo Sent: Sat 11/26/2005 4:50 PM To: r-help@stat.math.ethz.ch Cc: Subject: [R] IRT Package Hi all, Could anyone tell me if there is some package that fits any Item Response Model (further the ltm package)? Regards, Caio - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Find main effect in 2-way ANOVA
Hi It is not so clear to me what your intention is. Could you provide a reproducible example to show what you want to do. Regards, Christoph Buser -- Christoph Buser [EMAIL PROTECTED] Seminar fuer Statistik, LEO C13 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-44-632-4673 fax: 632-1228 http://stat.ethz.ch/~buser/ -- Gao Fay writes: Hi, I use anova() to find interaction effect and then I need to find data with main effect from those data with interaction effect. How to do that? I used : anova(lm(data~factor1*factor2)), then select data with interaction effect. Then I need to select those data also with main effect of factor1 or factor2, from previous selected data. How to do that? Many thanks for your time on my quesiton! Fay __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to do the multiple plots?
On 26 Nov 2005 at 15:40, Wei Qiu wrote: Date sent: Sat, 26 Nov 2005 15:40:52 -0500 (EST) From: Wei Qiu [EMAIL PROTECTED] To: Gabor Grothendieck [EMAIL PROTECTED] Copies to: r-help r-help@stat.math.ethz.ch Subject:Re: [R] How to do the multiple plots? Dear Babor and all, Thanks for your quick response. I tried the following. We can plot y1 and Y2 on one figs. It just shows one Y axis on the left side. I would like to show the Y1 axis on left side and Y2 Axis on right side. Any others input, Hi so add to your evening reading also ?axis and other functions from See also chapters in man pages. HTH Petr Wei On Sat, 26 Nov 2005, Gabor Grothendieck wrote: ?lines ?matplot ?ts.plot library(zoo); ?plot.zoo On 11/26/05, Wei Qiu [EMAIL PROTECTED] wrote: Hi all, I am new in R tool. I have a basic question. I would like to do a combination of two multiple lines plots for one X-variable and two different sets (lists) of Y-variables. Any suggestion will be greatly appreciated. Thanks! Wei __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] str and structable error
Hallo I encountered a behaviour which puzzles me (but finally I did get what I wanted). I used structable and strucplot but I wanted to change names of variables in structable object. I tried to subset it, use names but to no avail. So I tried str and expected to get a structure of an object but: sss-structable(Titanic) str(sss) Error in [.structable(x, args[[1]], ) : subscript out of bounds Finally I learned, that I need to change attributes of structable object. Is this error message OK and I did not read documentation properly? Or is it normal that str gives an error on some objects but I just was not so lucky to meet one?. W2000, R2.2.0, vcd package Built: R 2.2.0; ; 2005-11- 22 14:23:44; windows, Best regards. Petr Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Looking for constrained optimisation code
___ Hi, I was just wondering if there was any available R code that could handle general constrained optimisation problems. At the moment I'm using nlminb and optim, both of which allow box constraints on the parameters, but ideally I'd like to be able to specify more general constraints on the solution space. Even if code isn't readily available, any tips on how to persuade optim/nlminb to cope with general constraints would also be much appreciated. Thanks! -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 ___ The information transmitted in this message and its attachme...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] How Can I change the acf's plot type?
In the R Document, the usage of the acf() is as follow: acf(x, lag.max = NULL, type = c(correlation, covariance, partial), plot = TRUE, na.action = na.fail, demean = TRUE, ...) But now I want to get the result picture like: plot(x,type=l) or plot(x,type=p) How can I do this with acf function? 致 礼! 广星 [EMAIL PROTECTED] 2005-11-28 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] any package to compare two scoring systems
Hi, I wonder if there is a package aimed at comparing two scoring systems. Such as, to compare a student's performance (scores or ranks) in two different testing systems to find out if they are consistent? Sorry if this question is too naive. It seems easy but just wonder if there are handy packages or special methodologies. Thank you, [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] obtaining a ROC curve
Hello, I have a classification tree. I want to obtain a ROC curve for this test. What is the easiest way to obtain one? -Anjali did you try the ROCR package ? regards, Hans Vermeiren __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anova.gls from nlme on multiple arguments within a function fails
You've posed an excellent question with simple and elegant, reproducible example. I've seen no replies, so I will attempt a partial response. RSiteSearch(lexical scoping) produced some potentially useful comments (e.g., http://finzi.psych.upenn.edu/R/Rhelp02a/archive/37769.html), but nothing that allowed me to work around the problem. The following modification of your example makes it clear that anova.lme (called by anova.gls) choked on the second argument not the first: dummy2 - function(obj) + { + obj2 - obj[[2]] + anova(obj[[1]], obj2) + } dummy2(list(fm1, fm2)) Error in anova.lme(object = obj[[1]], obj2) : object obj2 not found The following helped isolate this further to dots - list(...), the second line in anova.lme: debug(anova.lme) dummy2(list(fm1, fm2)) I don't know why your example fails, especially anova.lm worked. Also, there should be a way to use something like assign to work around this problem, but nothing I tried worked. I know this is not a complete reply, but I hope it helps. spencer graves Markus Jantti wrote: Dear All -- I am trying to use within a little table producing code an anova comparison of two gls fitted objects, contained in a list of such object, obtained using nlme function gls. The anova procedure fails to locate the second of the objects. The following code, borrowed from the help page of anova.gls, exemplifies: --- start example code --- library(nlme) ## stolen from example(anova.gls) # AR(1) errors within each Mare fm1 - gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) anova(fm1) # variance changes with a power of the absolute fitted values? fm2 - update(fm1, weights = varPower()) anova(fm1, fm2) ## now define a little function dummy - function(obj) { anova(obj[[1]], obj[[2]]) } dummy(list(fm1, fm2)) ## compare with what happens in anova.lm: lm1 - lm(follicles ~ sin(2*pi*Time), Ovary) lm2 - lm(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary) dummy(list(lm1, lm2)) - end example code -- It is not the end of the world: I can easily work around this. But it would be nice to know why this does not work. Digging around using options(error=recover) did not help my much, I'm afraid. Best, Markus -- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA [EMAIL PROTECTED] www.pdf.com http://www.pdf.com Tel: 408-938-4420 Fax: 408-280-7915 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Question on KalmanSmooth
I am trying to use KalmanSmooth to smooth a time series fitted by arima (and with missing values), but the $smooth component of the output baffles me. Look at the following example: testts - arima.sim(list(ar=0.9),n=100) testts[6:14] - NA testmod - arima(testts, c(1,0,0)) testsmooth - KalmanSmooth(testts, testmod$model) par(mfrow=c(2,1)) plot(testsmooth$smooth, type=l) plot(testsmooth$var, type=l) Look at the lower panel plot, how the uncertainty of the smoothed values first is lowered, then being the highest at the end ( of the smoothed part, indexes 6:14). Anybody can explain this,or is this an error? Kjetil Halvorsen __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] str and structable error
Petr Pikal wrote: Hallo I encountered a behaviour which puzzles me (but finally I did get what I wanted). I used structable and strucplot but I wanted to change names of variables in structable object. I tried to subset it, use names but to no avail. So I tried str and expected to get a structure of an object but: sss-structable(Titanic) str(sss) Error in [.structable(x, args[[1]], ) : subscript out of bounds Looks like package vcd needs a separate structable method for the str() generic. Uwe Ligges Finally I learned, that I need to change attributes of structable object. Is this error message OK and I did not read documentation properly? Or is it normal that str gives an error on some objects but I just was not so lucky to meet one?. W2000, R2.2.0, vcd package Built: R 2.2.0; ; 2005-11- 22 14:23:44; windows, Best regards. Petr Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] [R-pkgs] glmpath: L1 regularization path for glms
We have uploaded to CRAN the first version of glmpath, which fits the L1 regularization path for generalized linear models. The lars package fits the entire piecewise-linear L1 regularization path for the lasso. The coefficient paths for L1 regularized glms, however, are not piecewise linear. glmpath uses convex optimization - in particular predictor-corrector methods- to fit the coefficient path at important junctions. These junctions are at the knots in |beta| where variables enter/leave the active set; i.e. nonzero/zero values. Users can request greater resolution at a cost of more computation, and compute values on a fine grid between the knots. The code is fast, and can handle largish problems efficiently. it took just over 4 sec system cpu time to fit the logistic regression path for the spam data from UCI with 3065 training obs and 57 predictors. For a microarray example with 5000 variables and 100 observations, 11 seconds cpu time. Currently glmpath implements binomial, poisson and gaussian families. Mee Young Park and Trevor Hastie --- Trevor Hastie [EMAIL PROTECTED] Professor, Department of Statistics, Stanford University Phone: (650) 725-2231 (Statistics) Fax: (650) 725-8977 (650) 498-5233 (Biostatistics) Fax: (650) 725-6951 URL: http://www-stat.stanford.edu/~hastie address: room 104, Department of Statistics, Sequoia Hall 390 Serra Mall, Stanford University, CA 94305-4065 ___ R-packages mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] str and structable error
Petr == Petr Pikal [EMAIL PROTECTED] on Mon, 28 Nov 2005 08:38:07 +0100 writes: Petr Hallo I encountered a behaviour which puzzles me (but Petr finally I did get what I wanted). Petr I used structable and strucplot but I wanted to change Petr names of variables in structable object. structable is not part of R : You should tell us that you are using an extra package where structable is from : namely -- I did your homework -- vcd Petr I tried to subset it, use names but to no avail. So I Petr tried str and expected to get a structure of an object Petr but: sss-structable(Titanic) str(sss) Petr Error in [.structable(x, args[[1]], ) : subscript Petr out of bounds yes, and similar problems from library(vcd) example(structable) str(hec) -- see below Petr Finally I learned, that I need to change attributes of Petr structable object. Petr Is this error message OK and I did not read Petr documentation properly? Or is it normal that str gives Petr an error on some objects but I just was not so lucky Petr to meet one?. No, it is not normal (and is a bug -- in vcd code IMO): The reason is that structable ``objects'' (S3) do not fulfill a fundamental property that all S (and hence R) objects should fulfill IMO {but read on before protesting} length() and [ should be compatible - namely, for an object 'x', if n - length(x) and assume n 0 for the moment, then x[j] should return something reasonable for all numeric vectors 'j' which have values in {1,2,...,n} (and also for {-n,...,-1}) This is unfortunately not at all true for structable objects. I'd say the authors of structable made a bit a peculiar decision when they designed the [.structable method since that invalidates the above basic principle. This is particularly unfortunate, since structable also inherits from ftable {a ``standard R'' S3 class} which does not have that bad property If the current [ (non-S-like IMO) behavior of structable objects really will be maintained in the future, one solution / workaround would be to define a simple str.structable method -- which would also help you for the moment : str.structable - function(object, ...) { cat(structable ) class(object) - class(object)[-1] str(object, ...) } str(structable(Titanic)) structable ftable [1:8, 1:4] 0 118 0 154 35 387 0 670 5 57 ... - attr(*, dnames)=List of 4 ..$ Class : chr [1:4] 1st 2nd 3rd Crew ..$ Sex : chr [1:2] Male Female ..$ Age : chr [1:2] Child Adult ..$ Survived: chr [1:2] No Yes - attr(*, split_vertical)= logi [1:4] FALSE TRUE FALSE TRUE - attr(*, col.vars)=List of 2 ..$ Sex : chr [1:2] Male Female ..$ Survived: chr [1:2] No Yes - attr(*, row.vars)=List of 2 ..$ Class: chr [1:4] 1st 2nd 3rd Crew ..$ Age : chr [1:2] Child Adult - attr(*, class)= chr ftable Regards, Martin Maechler, ETH Zurich Petr W2000, R2.2.0, vcd package Built: R 2.2.0; ; 2005-11- Petr 22 14:23:44; windows, Petr Best regards. Petr Petr Petr Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] possible Probabilstic models in R
HI LIST i am a new R user,i am trying to make a model,which will give me output in probability,which will take predictors series as input and my predictand as output.What is the package and what is the function for probability model.What are the possible methods for fitting such type of model,and what is the package name for such type of functions. thanks in advance. anil ANIL KUMAR( METEOROLOGIST GR -II) LRF SECTION NATIONAL CLIMATE CENTER ADGM(RESEARCH) INDIA METEOROLOGICAL DEPARTMENT SHIVIJI NAGAR PUNE-411005 INDIA MOBILE +919422023277 [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] str and structable error
I encountered a behaviour which puzzles me (but finally I did get what I wanted). I used structable and strucplot but I wanted to change names of variables in structable object. I tried to subset it, use names but to no avail. So I tried str and expected to get a structure of an object but: sss-structable(Titanic) str(sss) Error in [.structable(x, args[[1]], ) : subscript out of bounds Looks like package vcd needs a separate structable method for the str() generic. yes! Thanks for pointing this out. It's because [.structable has a non-standard behavior. Using: [.structable = function(object, ...) NextMethod() at the command line, str() would work as expected. David Uwe Ligges Finally I learned, that I need to change attributes of structable object. Is this error message OK and I did not read documentation properly? Or is it normal that str gives an error on some objects but I just was not so lucky to meet one?. W2000, R2.2.0, vcd package Built: R 2.2.0; ; 2005-11- 22 14:23:44; windows, Best regards. Petr Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Dr. David Meyer Department of Information Systems and Operations Vienna University of Economics and Business Administration Augasse 2-6, A-1090 Wien, Austria, Europe Fax: +43-1-313 36x746 Tel: +43-1-313 36x4393 HP: http://wi.wu-wien.ac.at/~meyer/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How Can I change the acf's plot type?
On Mon, 28 Nov 2005, [gb2312] ¹ãÐÇ wrote: In the R Document, the usage of the acf() is as follow: acf(x, lag.max = NULL, type = c(correlation, covariance, partial), plot = TRUE, na.action = na.fail, demean = TRUE, ...) But now I want to get the result picture like: plot(x,type=l) or plot(x,type=p) How can I do this with acf function? From the very same help page The generic function 'plot' has a method for objects of class 'acf'. so use that directly: it has a 'type' parameter. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] mathematical expressions ...
hi all i have a few questions about formatting plots: 1. i would like to add a symbol such as chi squared with 3 degrees of freedom onto a plot.expression(chi^2 == jnfdjb), can be used in conjuction with legend to solve this but how does one include an under score for the degrees of freedom 2. on the y axis: how does one change the orientation of the label from vertical to horisontal 3. can one add dots (not lines) to a barplot (ie : inside each of the bars) sorry if the questions are too simple __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Fwd: Matrix rotation
On Thu, 24 Nov 2005, Benjamin Lloyd-Hughes wrote: Ok I warned you that I'd been drinking! What I really meant was something to go from: [,1] [,2] [1,]12 [2,]43 to [,1] [,2] [1,]41 [2,]32 to [,1] [,2] [1,]34 [2,]21 to [,1] [,2] [1,]23 [2,]14 Another possible solution... library(matlab) x - matrix(c(1,2,4,3), nrow=2, byrow=TRUE) x [,1] [,2] [1,]12 [2,]43 matlab::rot90(x, 3) [,1] [,2] [1,]41 [2,]32 matlab::rot90(x, 2) [,1] [,2] [1,]34 [2,]21 matlab::rot90(x, 1) [,1] [,2] [1,]23 [2,]14 -- SIGSIG -- signature too long (core dumped) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anova.gls from nlme on multiple arguments within a function fails
The error is in anova.gls(): traceback() would have told you that was involved. It ends do.call(anova.lme, as.list(match.call()[-1])) and that call needs to be evaluated in the parent, not in the body of anova.lme. Several similar errors (e.g. in the update methods) in package nlme have been corrected over the years. Replacing anova() by anova.lme() in dummy() works. If you want to do this sort of thing more generally (e.g. messing with the contents of '...'), the elegant way is Call - match.call() Call[[1]] - as.name(anova.lme) eval.parent(Call) and that works here. Since at some later point substitute() is used to find the arguments, here you don't want to use do.call() with the evaluated arguments, which is the way it is intended to be used. Similarly, anova.lme(object, ...) is not what you want. On Sun, 27 Nov 2005, Spencer Graves wrote: You've posed an excellent question with simple and elegant, reproducible example. I've seen no replies, so I will attempt a partial response. RSiteSearch(lexical scoping) produced some potentially useful comments (e.g., http://finzi.psych.upenn.edu/R/Rhelp02a/archive/37769.html), but nothing that allowed me to work around the problem. The following modification of your example makes it clear that anova.lme (called by anova.gls) choked on the second argument not the first: It actually chokes on both. dummy2 - function(obj) + { + obj2 - obj[[2]] + anova(obj[[1]], obj2) + } dummy2(list(fm1, fm2)) Error in anova.lme(object = obj[[1]], obj2) : object obj2 not found The following helped isolate this further to dots - list(...), the second line in anova.lme: debug(anova.lme) dummy2(list(fm1, fm2)) I don't know why your example fails, especially anova.lm worked. Also, there should be a way to use something like assign to work around this problem, but nothing I tried worked. I know this is not a complete reply, but I hope it helps. spencer graves Markus Jantti wrote: Dear All -- I am trying to use within a little table producing code an anova comparison of two gls fitted objects, contained in a list of such object, obtained using nlme function gls. The anova procedure fails to locate the second of the objects. The following code, borrowed from the help page of anova.gls, exemplifies: --- start example code --- library(nlme) ## stolen from example(anova.gls) # AR(1) errors within each Mare fm1 - gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) anova(fm1) # variance changes with a power of the absolute fitted values? fm2 - update(fm1, weights = varPower()) anova(fm1, fm2) ## now define a little function dummy - function(obj) { anova(obj[[1]], obj[[2]]) } dummy(list(fm1, fm2)) ## compare with what happens in anova.lm: lm1 - lm(follicles ~ sin(2*pi*Time), Ovary) lm2 - lm(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary) dummy(list(lm1, lm2)) - end example code -- It is not the end of the world: I can easily work around this. But it would be nice to know why this does not work. Digging around using options(error=recover) did not help my much, I'm afraid. Best, Markus -- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA [EMAIL PROTECTED] www.pdf.com http://www.pdf.com Tel: 408-938-4420 Fax: 408-280-7915 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] mathematical expressions ...
[EMAIL PROTECTED] wrote: hi all i have a few questions about formatting plots: 1. i would like to add a symbol such as chi squared with 3 degrees of freedom onto a plot.expression(chi^2 == jnfdjb), can be used in conjuction with legend to solve this but how does one include an under score for the degrees of freedom See ?plotmath and use the index brackets. 2. on the y axis: how does one change the orientation of the label from vertical to horisontal See ?par, in particular its argument las. 3. can one add dots (not lines) to a barplot (ie : inside each of the bars) Yes, use points() to add dots, and the invisibly returned value of barplot() contains information on the postition of the bars. Uwe Ligges sorry if the questions are too simple __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How Can I change the acf's plot type?
Oops,I got it! plot(acf(x,plot=false),type=l,col=red) will be OK! Thank you very much! === 2005-11-28 18:09:03 您在来信中写道:=== On Mon, 28 Nov 2005, [gb2312] 广星 wrote: In the R Document, the usage of the acf() is as follow: acf(x, lag.max = NULL, type = c(correlation, covariance, partial), plot = TRUE, na.action = na.fail, demean = TRUE, ...) But now I want to get the result picture like: plot(x,type=l) or plot(x,type=p) How can I do this with acf function? From the very same help page The generic function 'plot' has a method for objects of class 'acf'. so use that directly: it has a 'type' parameter. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 = = = = = = = = = = = = = = = = = = = = 致 礼! 广星 [EMAIL PROTECTED] 2005-11-28 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] glm: quasi models with logit link function and binary data
# Hello R Users, # # I would like to fit a glm model with quasi family and # logistical link function, but this does not seam to work # with binary data. # # Please don't suggest to use the quasibinomial family. This # works out, but when applied to the true data, the # variance function does not seams to be # appropriate. # # I couldn't see in the # theory why this does not work. # Is this a bug, or are there theoretical reasons? # One problem might be, that logit(0)=-Inf and logit(1)=Inf. # But I can't see how this disturbes the calculation of quasi-Likelihood. # # Thank you very much, # best, # # Björn set.seed(0) y - sample(c(0,1), size=100, replace=T) # the following models work: glm(y ~ 1) glm(y ~ 1, family=binomial(link=logit)) glm(y ~ 1, family=quasibinomial(link=logit)) # the next model doesn't work: glm(y ~ 1, family=quasi(link=logit)) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Xemacs
Hi all, How can I stop my xemacs from lauching R whenever it starts? I want to use the usual M-x R instead. This is something I have to edit in the init file. Thanks Mahdi -- --- Mahdi Osman (PhD) E-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] using minor tickmarks with xYplot
Hi all, I'm trying to make a plot with the function xYplot from package Hmisc in R. I would like to have minor tick-marks on the axis. This should be a common simple feature to have but I don't seem to find any discussion on the topic. Following is one of the things I tried and the error returned: xYplot(y~x,data.frame(x=seq(1,10),y=runif(10)),minor.ticks=c(3.5,5.5)) Error in panel(x = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), y = c(0.88172451662831, : object gfun not found It's important that I use xYplot and not plot so function minor.tick() is not useful. Anything I can try? Thanks in advance for your help. vn __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] About the error of the expentancy of life
Dear R users: I am looking for information on how to compute the error in an estimation of the expentancy of life using survival analysis methods. I am interesting either in the theoretical calculations or in the way to carry out the analysis using R. I know that the mean life can be computed in R using the function cph from the Design package, but what about the error of this estimation. Cheers, Juan Pablo. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] glm: quasi models with logit link function and binary data
Björn Stollenwerk wrote: # Hello R Users, # # I would like to fit a glm model with quasi family and # logistical link function, but this does not seam to work # with binary data. # # Please don't suggest to use the quasibinomial family. This # works out, but when applied to the true data, the # variance function does not seams to be # appropriate. # # I couldn't see in the # theory why this does not work. # Is this a bug, or are there theoretical reasons? # One problem might be, that logit(0)=-Inf and logit(1)=Inf. # But I can't see how this disturbes the calculation of quasi-Likelihood. # # Thank you very much, # best, # # Björn set.seed(0) y - sample(c(0,1), size=100, replace=T) # the following models work: glm(y ~ 1) glm(y ~ 1, family=binomial(link=logit)) glm(y ~ 1, family=quasibinomial(link=logit)) # the next model doesn't work: glm(y ~ 1, family=quasi(link=logit)) This is an issue with the starting values provided to glm. Take a look at the difference between: quasibinomial()$initialize and quasi(logit)$initialize and where this is used in glm.fit and you should see the why the error occurs. To avoid this, you can supply your own starting values from a call to glm mustart - predict(glm(y ~ 1, binomial), type = response) glm(y ~ 1, quasi(logit), mustart = mustart) or just use: glm(y ~ 1, quasi(logit), mustart = rep(0.5, length(y))) HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] background computation,
Hi list, Is there a way to process R commands in the background other then using R in batch mode? I'm looking for the equivalent of the operator on the *nix commandline. Cheers, Koen __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How Can I change the acf's plot type?
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] analzying multiple variables (dv) in a sequence by using fit.mult.impute together with a MICE.object
Dear list members, my problem is to analyze multiple variables by using a simple loop. Without a loop, no problem: fit1 - fit.mult.impute(variable_from_MIC_datset ~ group, fitter=ols, xtrans=imp.dmat) Without a multiple imputation data set, that works: vars - c( lverb.ona, l2, lalles.ona, vl, notdmer.ona, pisalern.ona, lern, pswa, pswn, pska, pskd, pskt, pkoo, pkom, isall, vorwisse, im, ke, sb, an, akog, aemo, amb, stru) for(i in vars) { lm(dmat[,i]~ group) } However, I do not know how to specifiy the following correctly with the MICE object: for(i in vars) { fit1 - fit.mult.impute(?? ~ group, fitter=ols, xtrans=imp.dmat) } Looking into the structure of MICE objects, each of the x multiple imputed datasets is stored in a data.frame within a list. That list is named after the respective variable. If I specify just the variable like imp.dmat$imp$var_name that does not work, because it is just the name of the list element. Otherwise by specifying one of the columns with the list element, the multiple datasets would be missed. I thought about using eval() or expr() but without real succes. Every hint is appreciated, best regards leo gürtler __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] background computation,
Hey Koen, Is there a way to process R commands in the background other then using R in batch mode? I'm looking for the equivalent of the operator on the *nix commandline. Well, that's not R-specific, but what I do is to use screen, which is a handy little program that emulates multiple screens in one console. So you start screen, fire up R, work with it as usual; then with Ctrl-a-d you can detach from the screen and do whatever you want before reattaching with screen -r. More info with man screen. :) Best, Marc -- Dipl. Inform. Med. Marc Kirchner Interdisciplinary Centre for Scientific Computing (IWR) Multidimensional Image Processing INF 368 University of Heidelberg D-69120 Heidelberg Tel: ++49-6221-54 87 97 Fax: ++49-6221-54 88 50 [EMAIL PROTECTED] signature.asc Description: Digital signature __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Games-Howell, Gabriel, Hochberg
Hello, I read a book about statistics in psychology. The authors use SPSS. They talk about post hoc tests after ANOVA finds significant effects: - Gabriel's procedure (for equal or slightly different sample sizes) - Hochberg's GT2 (for different sample sizes) - Games-Howell procedure (for populations with unequal variances) I could not find them in R. Do they not exist in R or are there any equivalents? I know that I can use Tukey HSD if the sample sizes are equal and the variances are homogeneous. Thanks! Claus __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Xemacs
Mahdi Osman m_osm at gmx.net writes: How can I stop my xemacs from lauching R whenever it starts? I want to use the usual M-x R instead. This is something I have to edit in the init file. Remove (start-R) at the end of the init file (assuming you use the John-Fox Version). Dieter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] How define global Variable?
Hello, I try to define a global variable. My example: R a - old R test - function () { a - new } R test() R a # shoud be new This doesn't work. I would like to modify the variable a in a procedure. How can I do that. Thank you for helping. Sven Knüppel (Germany-Berlin) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How Can I change the acf's plot type?
I am sososo sorry for my inattention to my EMail's format! I have change that. Thank you very much again! === 2005-11-28 21:19:16 Write:=== $A9cPG(B == $A9cPG(B [EMAIL PROTECTED] on Mon, 28 Nov 2005 19:16:31 +0800 writes: $A9cPG(B Oops,I got it! plot(acf(x,plot=false),type=l,col=red) almost, but not if you falsely write 'false' instead of 'FALSE' ! $A9cPG(B will be OK! $A9cPG(B Thank you very much! $A9cPG(B === 2005-11-28 18:09:03 [EMAIL PROTECTED]@#:(B=== On Mon, 28 Nov 2005, [gb2312] $A9cPG(B wrote: [ pretty neat how I see chinese letters in my mail reader {Emacs+VM of course} and even named citation automagically works... ] Martin Maechler, ETH Zurich In the R Document, the usage of the acf() is as follow: acf(x, lag.max = NULL, type = c(correlation, covariance, partial), plot = TRUE, na.action = na.fail, demean = TRUE, ...) But now I want to get the result picture like: plot(x,type=l) or plot(x,type=p) How can I do this with acf function? From the very same help page The generic function 'plot' has a method for objects of class 'acf'. so use that directly: it has a 'type' parameter. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 $A9cPG(B = = = = = = = = = = = = = = = = = = = = $A9cPG(B [EMAIL PROTECTED](B $A9cPG(B $A9cPG(B $A9cPG(B [EMAIL PROTECTED] $A(B2005-11-28 $A9cPG(B __ $A9cPG(B R-help@stat.math.ethz.ch mailing list $A9cPG(B https://stat.ethz.ch/mailman/listinfo/r-help $A9cPG(B PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html = = = = = = = = = = = = = = = = = = = = GuangXing [EMAIL PROTECTED] 2005-11-28 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How define global Variable?
The problem is that the a is within the function You can easily solve this by test - function () { a - new; return(a) } a=test() Best regards, Kristel (or test - function () { return(a - new)}) [EMAIL PROTECTED] wrote: Hello, I try to define a global variable. My example: R a - old R test - function () { a - new } R test() R a # shoud be new This doesn't work. I would like to modify the variable a in a procedure. How can I do that. Thank you for helping. Sven Knüppel (Germany-Berlin) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- __ Kristel JoossensPh.D. Student Research Center ORSTAT K.U. Leuven Naamsestraat 69 Tel: +32 16 326929 3000 Leuven, BelgiumFax: +32 16 326732 E-mail: [EMAIL PROTECTED] http://www.econ.kuleuven.be/public/ndbae49 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How define global Variable?
try a - old test - function () { assign(a, new, envir = .GlobalEnv) } test() a I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Monday, November 28, 2005 3:26 PM Subject: [R] How define global Variable? Hello, I try to define a global variable. My example: R a - old R test - function () { a - new } R test() R a # shoud be new This doesn't work. I would like to modify the variable a in a procedure. How can I do that. Thank you for helping. Sven Knüppel (Germany-Berlin) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How define global Variable?
[EMAIL PROTECTED] wrote: R a - old R test - function () { a - new } R test() R a # shoud be new This doesn't work. I would like to modify the variable a in a procedure. How can I do that. You may like to modify the variable, but who else wants you to? Functions should have zero side effects whenever possible. Wanting to muck with global variables is a big red flag that something is wrong with your program. It will become hard to debug or follow what is going on. Imagine, in six weeks time you look at: a = old test() if (a == new){ doSomething() } - well, its not obvious that 'a' could possibly have changed to new. Sure you could look at test() and see, but then test() could call something else that calls something else and then somewhere else 'a' is set. It can make for very very messy code. The solution is to return anything that changes. Example: a = old test=function(){return(list(a=new))} ttt = test() a = ttt$a That's probably the recommended way of returning multiple things from a function too - wrap them in a list and get them. Modifying global variables is very rarely the Right Thing. I'm sure someone will come up with a solution but it'll probably involve frames and environments and other messy magic language stuff you really dont want to get into. Keep It Simple, Sunshine. Barry __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] finding peaks in a simple dataset with R
Try, # work directly with data from the input files directory = system.file(Test, package = caMassClass) X = msc.rawMS.read.csv(directory, IMAC_normal_.*csv) Peaks = msc.peaks.find(X) # Find Peaks cat(nrow(Peaks), peaks were found in, Peaks[nrow(Peaks),2], files.\n) stopifnot( nrow(Peaks)==424 ) On my data to see that every thing works OK. Than I would convert your input.dat to CSV format: 2.00, 233 2.04, 220 ... 11.60, 540 12.00, 600 -- a peak! 12.04, 450 ... On Windows machine, you can do it by opening your file in excel, and saving it as CSV. Or possibly using test editor to replace ' ' with ', '. Than the script X = msc.rawMS.read.csv('.', Input.csv) Peaks = msc.peaks.find(X) cat(nrow(Peaks), peaks were found in, Peaks [nrow(Peaks),2], files.\n) should work. Other way, is to try: X = read.table(input.dat, header=TRUE) Y = X[,2] rownames(Y) = signif(X[,1], 6) Peaks = msc.peaks.find(Y) Which casts your data in correct format, described in documentation as: Spectrum data either in matrix format [nFeatures x nSamples] or in 3D array format [nFeatures x nSamples x nCopies]. Row names (rownames(X)) store M/Z mass of each row. I hope one of those solutions works for you. Good Luck. Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 23, 2005 5:47 PM To: r-help@stat.math.ethz.ch Cc: Tuszynski, Jaroslaw W. Subject: Re: [R] finding peaks in a simple dataset with R On Wednesday 23 November 2005 10:15 am, Tuszynski, Jaroslaw W. wrote: I am looking for some way to locate peaks in a simple x,y data set. See my 'msc.peaks.find' function in 'caMassClass', it has a simple peak finding algorithm. Jarek Tuszynski __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Jarek, Thanks for the tip. I was able to install the caMassClass package and all of its dependancies. In addition, I was able to run the examples on the manual pages. However, The format of the input data to the 'msc.peaks.find' function is not apparent to me. In its simplest form, my data looks something like this: 2.00 233 2.04 220 ... 11.60 540 12.00 600 -- a peak! 12.04 450 ... Here is an example R session, trying out the function you suggested: #importing my data like this: X - read.table(input.dat, header=TRUE) #from the example: Peaks = msc.peaks.find(X) #errors with: Error in sort(x, partial = unique(c(lo, hi))) : 'x' must be atomic Also: I have tried one of the functions ( 'getPeaks' ) listed on the 'msc.peaks.find' manual page, however I am still having a problem with the format of my data vs. what the function is expecting. #importing my data like this: X - read.table(input.dat, header=TRUE) #setup an output file for peak information peakfile - paste(peakinfo.csv, sep=/) #run the analysis: getPeaks(X,peakfile) #errors with: Error in area/max(area) : non-numeric argument to binary operator In addition: Warning message: no finite arguments to max; returning -Inf any ideas would be greatly appreciated! -- Dylan Beaudette Soils and Biogeochemistry Graduate Group University of California at Davis 530.754.7341 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How define global Variable?
In your current definitions a can not change value to new unless you type a-test(). If you want the results of the test to be global then you add something like this test -function()a-new This will always replace the existing value of a once you type test() regards Anthony- Original Message - From: [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Monday, November 28, 2005 3:26 PM Subject: [R] How define global Variable? Hello, I try to define a global variable. My example: R a - old R test - function () { a - new } R test() R a # shoud be new This doesn't work. I would like to modify the variable a in a procedure. How can I do that. Thank you for helping. Sven Knüppel (Germany-Berlin) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How define global Variable?
[EMAIL PROTECTED] wrote: Hello, I try to define a global variable. You should not do that unless you really know why you want it this way. You probably want to read the R Language Definition manual. Anyway, read ?assign if you want to proceed doing dangerous things. Uwe Ligges My example: R a - old R test - function () { a - new } R test() R a # shoud be new This doesn't work. I would like to modify the variable a in a procedure. How can I do that. Thank you for helping. Sven Knüppel (Germany-Berlin) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] optimization with inequalities
I have to estimate the following model for several group of observations : y(1-y) = p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y) with constraints : p[1]+p[3] = 1 p[1]+p[2]+p[3]+1 = 0 p[3] = 0 I use the following code : func - sum((y(1-y) - p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y))^2) estim - optim( c(1,0,0),func, method=L-BFGS-B , lower=c(1-p[3], -p[1]-p[3]-1, 0) ) and for some group of observations, I observe that the estimated parameters don't respect the constraints, espacially the first. Where's the problem please ? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How define global Variable?
See: http://tolstoy.newcastle.edu.au/~rking/R/help/05/11/15737.html and the responses. On 11/28/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, I try to define a global variable. My example: R a - old R test - function () { a - new } R test() R a # shoud be new This doesn't work. I would like to modify the variable a in a procedure. How can I do that. Thank you for helping. Sven Knüppel (Germany-Berlin) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] obtaining a ROC curve
See, my old post at http://finzi.psych.upenn.edu/R/Rhelp02a/archive/61879.html to see a list of ROC related packages and functions. One of them should work well for your application. All of them take data in the form: - x - real number value returned by the classifier - y - true labels / classes (only 2 levels allowed) In Case of classification trees it might be hard to get your hands on the x since your function might only return binary labels (classes), what gives you only 3 points on your ROC ( (0,0), (1,1) and one point calculated from returned labels). But you might find function that can return probabilities of each sample. For example if you use 'rpart' than: model = rpart( ytrain~., data = data.frame(cbind(ytrain,xtrain)), ...) Prob = predict(model, newdata=xtest, type=prob) x = Prob[,1] y = ytest will give you needed probabilities instead of classes. Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 25, 2005 4:23 PM To: r-help@stat.math.ethz.ch Subject: [R] obtaining a ROC curve Hello, I have a classification tree. I want to obtain a ROC curve for this test. What is the easiest way to obtain one? -Anjali - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] window in a waitbar style ?
Hello, Is there any function to display a waitbar window (using tclTk ?) Thanks for any help ! D. Ecotière __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] optimization with inequalities
Florent Bresson [EMAIL PROTECTED] writes: I have to estimate the following model for several group of observations : y(1-y) = p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y) with constraints : p[1]+p[3] = 1 p[1]+p[2]+p[3]+1 = 0 p[3] = 0 I use the following code : func - sum((y(1-y) - p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y))^2) estim - optim( c(1,0,0),func, method=L-BFGS-B , lower=c(1-p[3], -p[1]-p[3]-1, 0) ) and for some group of observations, I observe that the estimated parameters don't respect the constraints, espacially the first. Where's the problem please ? If you think the boundaries in lower=c() are recomputed as the iteration progresses, you're wrong. L-BGFS-B does box constraints only. Instead parametrize using q1=p1+p3 q2=p1+p2+p3 q3=p3 which is easily inverted to get the p's from the q's. Then optimize as a function of q1..q3, substituting the inversion in the expression for func (which btw needs to be a _function_), using the relevant box constraints. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] optimization with inequalities
On Mon, 28 Nov 2005, Florent Bresson wrote: I have to estimate the following model for several group of observations : y(1-y) = p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y) with constraints : p[1]+p[3] = 1 p[1]+p[2]+p[3]+1 = 0 p[3] = 0 I use the following code : func - sum((y(1-y) - p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y))^2) estim - optim( c(1,0,0),func, method=L-BFGS-B , lower=c(1-p[3], -p[1]-p[3]-1, 0) ) and for some group of observations, I observe that the estimated parameters don't respect the constraints, espacially the first. Where's the problem please ? User mis-reading the help page! L-BFGS-B handles `box constraints', not linear inequality constraints. You can reparametrize to make these box constraints: use p[3], p[1]+p[3] and p[1]+p[2]+p[3] are variables. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] optimization with inequalities
If I understand this correctly the variables over which you are optimizing are p[1], p[2] and p[3] whereas x and y are fixed and known during the optimization. In that case its a linear programming problem and you could use the lpSolve library which would allow the explicit specification of the constraints. On 11/28/05, Florent Bresson [EMAIL PROTECTED] wrote: I have to estimate the following model for several group of observations : y(1-y) = p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y) with constraints : p[1]+p[3] = 1 p[1]+p[2]+p[3]+1 = 0 p[3] = 0 I use the following code : func - sum((y(1-y) - p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y))^2) estim - optim( c(1,0,0),func, method=L-BFGS-B , lower=c(1-p[3], -p[1]-p[3]-1, 0) ) and for some group of observations, I observe that the estimated parameters don't respect the constraints, espacially the first. Where's the problem please ? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] GLMM: measure for significance of random variable?
Hi, I have three questions concerning GLMMs. First, I ' m looking for a measure for the significance of the random variable in a glmm. I'm fitting a glmm (lmer) to telemetry-locations of 12 wildcat-individuals against random locations (binomial response). The individual is the random variable. Now I want to know, if the individual (TIER) has a significant effect on the model outcome. Does such a measure exist in R? My second question is, if there is a predict-function for glmms in R? Because I would like to produce a predictive habitat-map (someone asked that before, but I think there was no answer so far). And the third, why the method laplace doesn't work with all my models. thank you very much nina klar R output for a model, which works with laplace: model4a-lmer(RESPONSE~ D_TO_FORAL + + I((DIST_WATER-200)*(DIST_WATER200)) + + I((DIST_VILL-900)*(DIST_VILL900)) + + (1|TIER), family=binomial, method=Laplace) summary(model4a) Generalized linear mixed model fit using Laplace Formula: RESPONSE ~ D_TO_FORAL + I((DIST_WATER - 200) * (DIST_WATER 200)) + I((DIST_VILL - 900) * (DIST_VILL 900)) + (1 | TIER) Family: binomial(logit link) AIC BIClogLik deviance 3291.247 3326.739 -1639.623 3279.247 Random effects: GroupsNameVarianceStd.Dev. TIER (Intercept) 5e-10 2.2361e-05 # of obs: 2739, groups: TIER, 12 Estimated scale (compare to 1) 1.476153 Fixed effects: Estimate Std. Error z value Pr(|z|) (Intercept) 0.19516572 0.05812049 3.3580 0.0007852 *** D_TO_FORAL -0.01091458 0.00113453 -9.6204 2.2e-16 *** I((DIST_WATER - 200) * (DIST_WATER 200)) -0.00551492 0.00061907 -8.9084 2.2e-16 *** I((DIST_VILL - 900) * (DIST_VILL 900))0.00307265 0.00025708 11.9521 2.2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Correlation of Fixed Effects: (Intr) D_TO_F I-2*(2 D_TO_FORAL -0.247 I((DI-2*(2 0.561 -0.023 I((DI-9*(9 0.203 0.047 -0.206 here is the R-output for a model which doesn't work with laplace: model4b-lmer(RESPONSE~ D_TO_FORAL + + I((DIST_GREEN-300)*(DIST_GREEN300))+ + I((DIST_WATER-200)*(DIST_WATER200)) + + I((DIST_VILL-900)*(DIST_VILL900)) + + I((DIST_HOUSE-200)*(DIST_HOUSE200)) + + (1|TIER), family=binomial, method=Laplace) Fehler in optim(PQLpars, obj, method = L-BFGS-B, lower = ifelse(const, : non-finite finite-difference value [7] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anova.gls from nlme on multiple arguments within a function fails
Dear Prof. Ripley: Thanks very much. I tried several superficially similar things but not either of the solutions you suggest. Best Wishes, spencer graves Prof Brian Ripley wrote: The error is in anova.gls(): traceback() would have told you that was involved. It ends do.call(anova.lme, as.list(match.call()[-1])) and that call needs to be evaluated in the parent, not in the body of anova.lme. Several similar errors (e.g. in the update methods) in package nlme have been corrected over the years. Replacing anova() by anova.lme() in dummy() works. If you want to do this sort of thing more generally (e.g. messing with the contents of '...'), the elegant way is Call - match.call() Call[[1]] - as.name(anova.lme) eval.parent(Call) and that works here. Since at some later point substitute() is used to find the arguments, here you don't want to use do.call() with the evaluated arguments, which is the way it is intended to be used. Similarly, anova.lme(object, ...) is not what you want. On Sun, 27 Nov 2005, Spencer Graves wrote: You've posed an excellent question with simple and elegant, reproducible example. I've seen no replies, so I will attempt a partial response. RSiteSearch(lexical scoping) produced some potentially useful comments (e.g., http://finzi.psych.upenn.edu/R/Rhelp02a/archive/37769.html), but nothing that allowed me to work around the problem. The following modification of your example makes it clear that anova.lme (called by anova.gls) choked on the second argument not the first: It actually chokes on both. dummy2 - function(obj) + { + obj2 - obj[[2]] + anova(obj[[1]], obj2) + } dummy2(list(fm1, fm2)) Error in anova.lme(object = obj[[1]], obj2) : object obj2 not found The following helped isolate this further to dots - list(...), the second line in anova.lme: debug(anova.lme) dummy2(list(fm1, fm2)) I don't know why your example fails, especially anova.lm worked. Also, there should be a way to use something like assign to work around this problem, but nothing I tried worked. I know this is not a complete reply, but I hope it helps. spencer graves Markus Jantti wrote: Dear All -- I am trying to use within a little table producing code an anova comparison of two gls fitted objects, contained in a list of such object, obtained using nlme function gls. The anova procedure fails to locate the second of the objects. The following code, borrowed from the help page of anova.gls, exemplifies: --- start example code --- library(nlme) ## stolen from example(anova.gls) # AR(1) errors within each Mare fm1 - gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) anova(fm1) # variance changes with a power of the absolute fitted values? fm2 - update(fm1, weights = varPower()) anova(fm1, fm2) ## now define a little function dummy - function(obj) { anova(obj[[1]], obj[[2]]) } dummy(list(fm1, fm2)) ## compare with what happens in anova.lm: lm1 - lm(follicles ~ sin(2*pi*Time), Ovary) lm2 - lm(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary) dummy(list(lm1, lm2)) - end example code -- It is not the end of the world: I can easily work around this. But it would be nice to know why this does not work. Digging around using options(error=recover) did not help my much, I'm afraid. Best, Markus -- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA [EMAIL PROTECTED] www.pdf.com http://www.pdf.com Tel: 408-938-4420 Fax: 408-280-7915 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA [EMAIL PROTECTED] www.pdf.com http://www.pdf.com Tel: 408-938-4420 Fax: 408-280-7915 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Durbin-Watson Critical Values Tables
Hello to everyone!... I would like to ask you if there is a way to extract the known Durbin-Watson critical values (D_L and D_U - lower and upper limits) within R, as we do in the DW statistic tables at the end of Econometrics Textbooks, because packages car and lmtest seem to provide only the p-value (it is useful, but I would like to have the exact critical vaues). Thank you very much in advance, Tsardounis Constantine __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Graph plots
Dear R people, I am currently experimenting with graph plotting using libraries Rgraphviz, graph, etc. as needed by GeneTS (bioconductor project). The plots I get use huge fonts to label the nodes and the edges and that often makes the plot unreadable (overlapping edge labels etc). The question is perhaps more related to graph attribute values of Graphviz, but I was hoping that there is a more straightforward way of making graphs more readable within R. Any advice/examples will be much appreciated. Thanks in advance, georgia __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Looking for constrained optimisation code
On Mon, 28 Nov 2005, Hong Ooi wrote: Hi, I was just wondering if there was any available R code that could handle general constrained optimisation problems. At the moment I'm using nlminb and optim, both of which allow box constraints on the parameters, but ideally I'd like to be able to specify more general constraints on the solution space. constrOptim() allows linear inequality constraints. -thomas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] read.spss problem
Hello, I am having trouble reading an spss file into R. I have reset my working directory to the folder where this file is stored. This is what I've typed into R and the error message I received: + getwd() [1] /Users/daviacox/Graduate School/PLS 801 read.spss(norwil.spss) Error in read.spss(norwil.spss) : error reading portable-file dictionary In addition: Warning message: Expected variable count record Please help, I don't have SPSS on my computer (I am re-analyzing some data for a statistics project) so I can't alter the file that way. Thanks again for your help. Davia Davia S. Cox Global Urban Studies Program Graduate Assistant/Doctoral Student 305 Berkey Hall East Lansing, MI 48825 517-353-5987 Office 517-353-6680 Fax [EMAIL PROTECTED] One of the penalties for refusing to participate in politics is that you end up being governed by your inferiors. -Plato __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Robust fitting
Good evening,I am Marta Colombo, student of Politecnico di Milano. I'm studying Local Regression Techniques such as loess, smoothing splines and kernel smoothers. Choosing symmetric for the argument family in loess function it is possible to produce a robust estimate , in function smooth.spline and ksmooth I didn't find this possibility. Well, is there a way to produce a robust estimate using smoothing splines or kernel smoothers? And if the answer is no, why? I'm asking these questions because I need to know loess' advantages and disadvantages compared to other techniques. Thank you very much for attention, Marta Colombo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] using minor tickmarks with xYplot
Viet Nguyen wrote: Hi all, I'm trying to make a plot with the function xYplot from package Hmisc in R. I would like to have minor tick-marks on the axis. This should be a common simple feature to have but I don't seem to find any discussion on the topic. Following is one of the things I tried and the error returned: xYplot(y~x,data.frame(x=seq(1,10),y=runif(10)),minor.ticks=c(3.5,5.5)) Error in panel(x = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), y = c(0.88172451662831, : object gfun not found This is a bug in panel.xYplot. Charles Thomas Dupont will fix it and give you the URL to our CVS area containing the new version, then you can do source('http://') to override panel.xYplot until Thomas puts out a new version of Hmisc. -Frank It's important that I use xYplot and not plot so function minor.tick() is not useful. Anything I can try? Thanks in advance for your help. vn __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Robust fitting
http://www.maths.lth.se/help/R/.R/library/R.basic/html/robust.smooth.spline.html Best regards, Kristel Marta Colombo wrote: Good evening,I am Marta Colombo, student of Politecnico di Milano. I'm studying Local Regression Techniques such as loess, smoothing splines and kernel smoothers. Choosing symmetric for the argument family in loess function it is possible to produce a robust estimate , in function smooth.spline and ksmooth I didn't find this possibility. Well, is there a way to produce a robust estimate using smoothing splines or kernel smoothers? And if the answer is no, why? I'm asking these questions because I need to know loess' advantages and disadvantages compared to other techniques. Thank you very much for attention, Marta Colombo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] AIC and BIC from arima()
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 My ultimate goal is to best fit time series by comparing AICs and BICs (as in Bayesian) from arima() and nnet(). I looked at the arima.R source code, but I am afraid I do not understand it. What I only miss really is the number of parameters p, where: AIC = n*log(S/n) + 2*p with S the squared residuals and n the number of observations. Can I get p from arima() (for both non and seasonal cases) result? I am obviously not an expert in the matter, so please accept my apologies if this is a stupid question... Many thanks in advance, - -- Jean-Luc Fontaine http://jfontain.free.fr/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFDi1yOkG/MMvcT1qQRAgLkAJ49RWVGG0h2plx3OOA8x1pIQdimXgCfbJ2w kRog3Jj6q5uUHygyLn6Rbuo= =iSXZ -END PGP SIGNATURE- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Robust fitting
Note: As I believe Brian Ripley pointed out in his MASS book, loess may not be as resistant to outliers (which is one aspect of robustness; robustness of efficiency is another) as you think. The problem is that it starts off with LS estimates and these can be so distorted by unusual values that the reweighting cannot properly recover; i.e. convergence is to a local minimum far from the desired global one. You might wish to read the documentation for rlm() (in MASS, the package) and the appropriate sections of MASS, the book. Cheers, -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marta Colombo Sent: Monday, November 28, 2005 10:38 AM To: R help Subject: [R] Robust fitting Good evening,I am Marta Colombo, student of Politecnico di Milano. I'm studying Local Regression Techniques such as loess, smoothing splines and kernel smoothers. Choosing symmetric for the argument family in loess function it is possible to produce a robust estimate , in function smooth.spline and ksmooth I didn't find this possibility. Well, is there a way to produce a robust estimate using smoothing splines or kernel smoothers? And if the answer is no, why? I'm asking these questions because I need to know loess' advantages and disadvantages compared to other techniques. Thank you very much for attention, Marta Colombo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Use of axis() in conjunction with plot(..., axes=F)
Colleagues On occasion, I want to control either tick marks or labels in axes different from the defaults created with axes=T in the plot command. If I invoke axes=F and axis(n), I can do so. However, the axes produced by axis() differ slightly from those produced within plot. I have bty in par set to l (i.e., left and bottom axes only). Differences include: 1. when an axis contains a factor, plot() produces axes showing the actual factors whereas axis() replaces these factors with integers representing the level of the factor (e.g., if the factor is countries, plot() yields axes labeled Argentina, Brazil, etc. whereas axes() yields 1, 2, ... 2. axes produced by plot() are full-length (i.e., the axes connect at the corner of the plot) whereas axes produced by axis() are not full-length (i.e., they run between the smallest and largest label). It appears that this can be overcome by using the at option within axes(). However, I cannot figure out how to use the at option when the axis is a factor. Thoughts? Dennis Dennis Fisher MD P (The P Less Than Company) Phone: 1-866-PLessThan (1-866-753-7784) Fax: 1-415-564-2220 www.PLessThan.com [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] AIC and BIC from arima()
On Mon, 28 Nov 2005, Jean-Luc Fontaine wrote: My ultimate goal is to best fit time series by comparing AICs and BICs (as in Bayesian) from arima() and nnet(). Whoa! nnet() does not do maximum likelihood fitting so AIC and BIC are not even defined. On the other hand, ?WWWusage has an example of choosing an ARIMA fit by AIC. I looked at the arima.R source code, but I am afraid I do not understand it. What I only miss really is the number of parameters p, where: AIC = n*log(S/n) + 2*p with S the squared residuals and n the number of observations. Can I get p from arima() (for both non and seasonal cases) result? By reading the help page: coef: a vector of AR, MA and regression coefficients, which can be extracted by the 'coef' method. so length(fit$coef) will tell you how many parameters you have fitted, and if you read on aic: the AIC value corresponding to the log-likelihood. Only valid for 'method = ML' fits. You give us no idea where you got the formula for 'AIC' from, but it is not that introduced by Akaike (1973, 4) and commonly used in time-series (and by arima()). I think you are applying a formula applicable to linear regression for independent observations, incorrectly. There are really are a lot of subtleties here, and although p is well-defined, n is not. Thus applying Schwarz's criterion (aka BIC in one of its senses) is not at all clearcut, a not uncommon situation with non-iid sampling. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] read.spss problem
Davia Cox [EMAIL PROTECTED] writes: Hello, I am having trouble reading an spss file into R. I have reset my working directory to the folder where this file is stored. This is what I've typed into R and the error message I received: + getwd() [1] /Users/daviacox/Graduate School/PLS 801 read.spss(norwil.spss) Error in read.spss(norwil.spss) : error reading portable-file dictionary In addition: Warning message: Expected variable count record Please help, I don't have SPSS on my computer (I am re-analyzing some data for a statistics project) so I can't alter the file that way. Thanks again for your help. Hmm, what kind of file is this? SPSS data files are generally called .sav or .por. I wonder if you've got a syntax file on your hand, i.e. a file containing program code. Is it readable as a text file? Davia Davia S. Cox Global Urban Studies Program Graduate Assistant/Doctoral Student 305 Berkey Hall East Lansing, MI 48825 517-353-5987 Office 517-353-6680 Fax [EMAIL PROTECTED] One of the penalties for refusing to participate in politics is that you end up being governed by your inferiors. -Plato __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] overlay additional axes
Greetings, I am trying to add an extra labled axis in position 3 (top x-axis), with numbers that do not match up with the existing axes. Surely this must be possible, and I am just doing it incorectly. So far I have tried the following: #make a plot plot(TIK, type=l, cex=.25, xlim=c(2,32), ylim=c(0,1600)) #try and add a new axis with different numbers in position 3 axis(3,0.154/(2*sin(TIK[,1]/2*pi/180))) ...obviously the nature of the numbers in both axes is quite different. is it possible to have the bottom axis (degrees 2Theta) line up with a corosponding top axis of 0.154/(2*sin(TIK[,1]/2*pi/180)) ? thanks in advance! -- Dylan Beaudette Soils and Biogeochemistry Graduate Group University of California at Davis 530.754.7341 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Use of axis() in conjunction with plot(..., axes=F)
On Mon, 2005-11-28 at 13:18 -0800, Dennis Fisher wrote: Colleagues On occasion, I want to control either tick marks or labels in axes different from the defaults created with axes=T in the plot command. If I invoke axes=F and axis(n), I can do so. However, the axes produced by axis() differ slightly from those produced within plot. I have bty in par set to l (i.e., left and bottom axes only). Differences include: 1. when an axis contains a factor, plot() produces axes showing the actual factors whereas axis() replaces these factors with integers representing the level of the factor (e.g., if the factor is countries, plot() yields axes labeled Argentina, Brazil, etc. whereas axes() yields 1, 2, ... Without your actual code here, I may be wrong, but I am going to guess that the difference is that when you are using a factor, plot.factor() gets used, which ends up using barplot() in the case where 'x' is a factor. plot.factor() by default uses table(x) on the 'x' argument from the initial plot() call and passes this to barplot(). barplot() by default uses the names attribute of the table object created above as the 'names.arg' argument and thus, the resultant labels on the x axis. Hence, there is an implicit coercion of the factor levels to character by using table(). If you specify axes = FALSE, there is no implicit coercion that takes place. You can do that yourself of course by using as.character(FACTOR) for the labels argument. See ?plot.factor and ?barplot for more information here. 2. axes produced by plot() are full-length (i.e., the axes connect at the corner of the plot) whereas axes produced by axis() are not full-length (i.e., they run between the smallest and largest label). It appears that this can be overcome by using the at option within axes(). However, I cannot figure out how to use the at option when the axis is a factor. Thoughts? For number 2, plotting functions such as plot.default use box() to place a full frame around the plot region. In plot.default(), this is done using the 'frame.plot' argument, which is set by default to the value of the 'axes' argument. So, if you set 'axes = FALSE', box() is not used. So just call it explicitly after using axis(). See ?box(). HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Durbin-Watson Critical Values Tables
On Mon, 28 Nov 2005, Constantine Tsardounis wrote: Hello to everyone!... I would like to ask you if there is a way to extract the known Durbin-Watson critical values (D_L and D_U - lower and upper limits) within R, as we do in the DW statistic tables at the end of Econometrics Textbooks, because packages car and lmtest seem to provide only the p-value (it is useful, but I would like to have the exact critical vaues). lmtest and car do not *only* provide p values, they are able to provide a p-value whereas using the upper and lower bounds you might obtain inconclusive results. Hence, the p values yield more precise results! It is not possible to provide a single table of critical values because the null distribution depends on the regressor matrix. If you really want to have a single critical value for a particular problem, look at the implementations of dwtest() or durbin.watson() how to compute the full (approximate) null distribution. Best, Z Thank you very much in advance, Tsardounis Constantine __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] What made us so popular Nov 16-20?
Our main US mirror is cran.mirrors.pair.com, AKA cran.us.r-project.org. Pair.com keeps statistics on traffic on the mirror sites, and I got all excited when I looked at this page: http://mirrors.pair.com/pair/stats.html and saw that CRAN was 5th most popular over the last month, getting more visitors than Apache, MySQL, OpenOffice, etc. Then I looked at this graph: http://mirrors.pair.com/freebsd/stats/cran-ip.png and saw that this is likely due to a huge spike in traffic between Nov 16 and 20. Our visitors (not sure of the exact definition) went from the usual 10K/day up to 50-150K/day during that week. Did we get mentioned somewhere (e.g. Slashdot), or was someone just experimenting with some automated downloading? Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] qcc
violating.runs I read from the news cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf that the criteria for the violating is 5 but 1)I cannot find 5 in the code of the function. Where is the 5 ? 2)What is the easiest way to change it ? 3)Is there any more criterias made somewhere ? Yours sincerelly, Tommi Viitanen __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Looking for constrained optimisation code
___ You know, this is the first time I've heard of constrOptim. I actually have a rather complicated, nonlinear boundary expression in mind, so this function by itself isn't quite what I'm after. Still, I should be able to hack up a barrier function in my own code and feed that into optim/nlminb/constrOptim. Thanks! -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 -Original Message- From: Thomas Lumley [mailto:[EMAIL PROTECTED] Sent: Tuesday, 29 November 2005 5:31 AM To: Hong Ooi Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Looking for constrained optimisation code On Mon, 28 Nov 2005, Hong Ooi wrote: Hi, I was just wondering if there was any available R code that could handle general constrained optimisation problems. At the moment I'm using nlminb and optim, both of which allow box constraints on the parameters, but ideally I'd like to be able to specify more general constraints on the solution space. constrOptim() allows linear inequality constraints. -thomas ___ The information transmitted in this message and its attachme...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] What made us so popular Nov 16-20?
Duncan asks: Did we get mentioned somewhere (e.g. Slashdot), or was someone just experimenting with some automated downloading? R was mentioned in last week's (I think) O'Reilly newsletter, which included a link to a short article showing how easy it is to get R to graph stuff like stock price histories. That's the publisher, not the talking head. For what it's worth, the article isn't worth chasing down. It left a beginner like me disappointed that R's capabilities weren't better shown, and that he relied on Perl to do data manipulation. cur -- Curt Seeliger, Data Ranger CSC, EPA/WED contractor 541/754-4638 [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] glm: quasi models with logit link function and binary data
___ This would be because quasi(link=logit) doesn't actually fit a logistic regression. The default variance function for quasi is the identity, not binomial variance. To emulate a logistic regression, use var=mu(1-mu) in addition to link=logit. y - runif(100) glm(y ~ 1, family=binomial) Call: glm(formula = y ~ 1, family = binomial) Coefficients: (Intercept) -0.01208 Degrees of Freedom: 99 Total (i.e. Null); 99 Residual Null Deviance: 37.15 Residual Deviance: 37.15AIC: 140.6 Warning message: non-integer #successes in a binomial glm! in: eval(expr, envir, enclos) glm(y ~ 1, family=quasi(var=mu(1-mu), link=logit)) Call: glm(formula = y ~ 1, family = quasi(var = mu(1-mu), link = logit)) Coefficients: (Intercept) -0.01208 Degrees of Freedom: 99 Total (i.e. Null); 99 Residual Null Deviance: 37.15 Residual Deviance: 37.15AIC: NA -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Björn Stollenwerk Sent: Monday, 28 November 2005 10:18 PM To: R-help@stat.math.ethz.ch Subject: [R] glm: quasi models with logit link function and binary data # Hello R Users, # # I would like to fit a glm model with quasi family and # logistical link function, but this does not seam to work # with binary data. # # Please don't suggest to use the quasibinomial family. This # works out, but when applied to the true data, the # variance function does not seams to be # appropriate. # # I couldn't see in the # theory why this does not work. # Is this a bug, or are there theoretical reasons? # One problem might be, that logit(0)=-Inf and logit(1)=Inf. # But I can't see how this disturbes the calculation of quasi-Likelihood. # # Thank you very much, # best, # # Björn set.seed(0) y - sample(c(0,1), size=100, replace=T) # the following models work: glm(y ~ 1) glm(y ~ 1, family=binomial(link=logit)) glm(y ~ 1, family=quasibinomial(link=logit)) # the next model doesn't work: glm(y ~ 1, family=quasi(link=logit)) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html ___ The information transmitted in this message and its attachme...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] What made us so popular Nov 16-20?
Duncan Murdoch [EMAIL PROTECTED] writes: Our main US mirror is cran.mirrors.pair.com, AKA cran.us.r-project.org. Pair.com keeps statistics on traffic on the mirror sites, and I got all excited when I looked at this page: http://mirrors.pair.com/pair/stats.html and saw that CRAN was 5th most popular over the last month, getting more visitors than Apache, MySQL, OpenOffice, etc. Then I looked at this graph: http://mirrors.pair.com/freebsd/stats/cran-ip.png and saw that this is likely due to a huge spike in traffic between Nov 16 and 20. Our visitors (not sure of the exact definition) went from the usual 10K/day up to 50-150K/day during that week. Did we get mentioned somewhere (e.g. Slashdot), or was someone just experimenting with some automated downloading? Kevin Farnham's article on O'Reilly might have something to do with it... http://www.onlamp.com/pub/a/onlamp/2005/11/17/r_for_statistics.html As the link suggests, it was published on the 17th. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] glm: quasi models with logit link function and binary data
___ Hm, I should have checked what would happen with binary data and not just continuous. Using glm with quasi(var=mu(1-mu), link=logit) indeed fails with NAs/NaNs when y is binary. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sundar Dorai-Raj Sent: Monday, 28 November 2005 11:20 PM To: Björn Stollenwerk Cc: R-help@stat.math.ethz.ch Subject: Re: [R] glm: quasi models with logit link function and binary data This is an issue with the starting values provided to glm. Take a look at the difference between: quasibinomial()$initialize and quasi(logit)$initialize and where this is used in glm.fit and you should see the why the error occurs. To avoid this, you can supply your own starting values from a call to glm mustart - predict(glm(y ~ 1, binomial), type = response) glm(y ~ 1, quasi(logit), mustart = mustart) or just use: glm(y ~ 1, quasi(logit), mustart = rep(0.5, length(y))) HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html ___ The information transmitted in this message and its attachme...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] What made us so popular Nov 16-20?
[EMAIL PROTECTED] writes: Duncan asks: Did we get mentioned somewhere (e.g. Slashdot), or was someone just experimenting with some automated downloading? R was mentioned in last week's (I think) O'Reilly newsletter, which included a link to a short article showing how easy it is to get R to graph stuff like stock price histories. That's the publisher, not the talking head. [See other mail for the link] For what it's worth, the article isn't worth chasing down. It left a beginner like me disappointed that R's capabilities weren't better shown, and that he relied on Perl to do data manipulation. Er, where did you see Perl being used? The only thing that irked me (admittedly, I only skimmed the article) was that he was using regression models to test for correlation (why not cor.test()?) and speculates a bit wildly about the sign of a clearly nonsignificant relation. It's a bit superficial, but I suspect that this sort of paper has to be. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] change axis format for different panels in xyplot in lattice
Utilizing panel.number and grid allowed me to do all my desired manipulations - thanks Deepayan! Roy Original message Date: Tue, 22 Nov 2005 13:47:20 -0600 From: Deepayan Sarkar [EMAIL PROTECTED] Subject: Re: change axis format for different panels in xyplot in lattice To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch On 11/22/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Dear R users, My apologies for a simple question for which I suspect there is a simple answer that I have yet to find. I'd like to plot panels in lattice with different graphical parameters for the axes. For example, the code x-rnorm(100) y-rnorm(100) z-c(rep(1,50), rep(2,50)) library(lattice) xyplot(y~x|z) plots two panels with the default black axes. Running the following code trellis.par.set(list(axis.line = list(col = transparent))) xyplot(y~x|z) plots the same data without the axes. Is it possible (in one plot) to plot the first panel with black axes and the second panel with tranparent axes? Not systematically, but consider this approach: library(grid) trellis.par.set(list(axis.line = list(col = transparent))) xyplot(y~x|z, panel = function(..., panel.number) { if (panel.number == 1) grid.rect(gp = gpar(col = 'black')) panel.xyplot(...) } ) This is probably not exactly what you want, since the tick marks are transparent in both panels, but you get the idea. You can gain finer control of the axis annotation using panel.axis inside your panel function (but you will need to disable clipping, controlled by trellis.par.get(clip)). Alternatively, check out ?trellis.focus. Deepayan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Looking for constrained optimisation code
Have you considered migrating the constraints into the objective function, then cranking up the penalty for constraint violation once you have a more or less feasible solution? spencer graves Hong Ooi wrote: ___ You know, this is the first time I've heard of constrOptim. I actually have a rather complicated, nonlinear boundary expression in mind, so this function by itself isn't quite what I'm after. Still, I should be able to hack up a barrier function in my own code and feed that into optim/nlminb/constrOptim. Thanks! -- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA [EMAIL PROTECTED] www.pdf.com http://www.pdf.com Tel: 408-938-4420 Fax: 408-280-7915 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] sensitivity tests fo causal inference
Hi all, Following up on Holger's email last week: Does anyone know if there exists a library that implements the sensitivity tests for hidden bias for matched pairs and unmatched groups as proposed in Rosenbaum's Observational Studies (2002: ch.4)? Thanks. Best, jens __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] What made us so popular Nov 16-20?
On 29 Nov 2005 01:45:34 +0100, Peter Dalgaard [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: Duncan asks: Did we get mentioned somewhere (e.g. Slashdot), or was someone just experimenting with some automated downloading? R was mentioned in last week's (I think) O'Reilly newsletter, which included a link to a short article showing how easy it is to get R to graph stuff like stock price histories. That's the publisher, not the talking head. [See other mail for the link] For what it's worth, the article isn't worth chasing down. It left a beginner like me disappointed that R's capabilities weren't better shown, and that he relied on Perl to do data manipulation. Er, where did you see Perl being used? The only thing that irked me (admittedly, I only skimmed the article) was that he was using regression models to test for correlation (why not cor.test()?) and speculates a bit wildly about the sign of a clearly nonsignificant relation. It's a bit superficial, but I suspect that this sort of paper has to be. That article not only gave the (false) impression that one needed something like perl to do data analysis but it failed to use time series objects to represent time series making the examples poor (e.g. x axis was labelled 1, 2, ... instead of using time) and unnecessarily lengthy and complex. By the way, during November there was also a vote on alt.comp.freeware for the pricelessware collection http://www.pricelesswarehome.org (which R failed to get on in 2005 but did manage to make it on for 2006) and this may have been the reason, in part, for the spike. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] rotated ylab with xyplot
hi all, in R, what's the best way to have a rotated ylab in a graph plotted with either xyplot or xYplot? I tried this but it didn't work. xyplot(y~x,data.frame(x=1:10,y=runif(10)),ylab=list(srt=90,crt=90,rot=90,label=my label)) more generally, how do you output a text at an angle in a lattice graph? what would be a good reference for R lattice graphics? I need more help than the help pages provide. thank you in advance. vn __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] rotated ylab with xyplot
Try library(grid) xyplot(y~x,data.frame(x=1:10,y=runif(10)), ylab=textGrob(label=my label, rot=0)) Note in the ?xyplot the xlab/ylab section points to the 'main' parameter where it defines that a list can be used, however string rotation parameters are not in the list. The helpfile notes that a grob object can be used. The reference for lattice and grid is R Graphics by Paul Murrell. --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Viet Nguyen Sent: Monday, November 28, 2005 8:33 PM To: r-help@stat.math.ethz.ch Subject: [R] rotated ylab with xyplot hi all, in R, what's the best way to have a rotated ylab in a graph plotted with either xyplot or xYplot? I tried this but it didn't work. xyplot(y~x,data.frame(x=1:10,y=runif(10)),ylab=list(srt=90,crt =90,rot=90,label=my label)) more generally, how do you output a text at an angle in a lattice graph? what would be a good reference for R lattice graphics? I need more help than the help pages provide. thank you in advance. vn __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] label point
Hi, I have a matrix: [,1] [,2] [1,] 11 31 [2,] 44 50 [3,] 23 100 [4,] 90 31 I use plot to draw the four points. Is there any way to label the point? for insatnce, for (11,31), it is 1, for (44,50), it is 4. Thanks! - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] label point
Hallo On 28 Nov 2005 at 21:33, Robert wrote: Date sent: Mon, 28 Nov 2005 21:33:24 -0800 (PST) From: Robert [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject:[R] label point Hi, I have a matrix: [,1] [,2] [1,] 11 31 [2,] 44 50 [3,] 23 100 [4,] 90 31 I use plot to draw the four points. Is there any way to label the point? for insatnce, for (11,31), it is 1, for (44,50), it is 4. Thanks! label.vec-c(1, 4, l2, l3.) plot(matrix) text(matrix, label.vec) Should do the trick but it overplots your points, so you need to shift positions e.g. by text(matrix+c(some offset,0), label.vec) HTH Petr - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] label point
See ?text e.g. plot(m[,1], m[,2]) # or plot(m) text(m[,1], m[,2], pos = 3, cex = 0.7) # 3 means above, 0.7 is 70% size On 11/29/05, Robert [EMAIL PROTECTED] wrote: Hi, I have a matrix: [,1] [,2] [1,] 11 31 [2,] 44 50 [3,] 23 100 [4,] 90 31 I use plot to draw the four points. Is there any way to label the point? for insatnce, for (11,31), it is 1, for (44,50), it is 4. Thanks! - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] qcc
Tommi Viitanen wrote: violating.runs I read from the news cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf that the criteria for the violating is 5 but 1)I cannot find 5 in the code of the function. Where is the 5 ? See ?violating.runs: violating.runs(object, run.length = qcc.options(run.length)) ^ ^^^ ^^^ ^^ ^^^ ^^^ And try qcc.options(run.length) [1] 5 Ah! 2)What is the easiest way to change it ? I'd try, e.g., qcc.options(run.length = 6) or directly violating.runs(object, run.length = 6) 3)Is there any more criterias made somewhere ? No, looking 10 seconds into the code, but why do you not read it yourself? It is easily understandable and you will also see at once that you can will get a performance boost by optimizing that code Uwe Ligges Yours sincerelly, Tommi Viitanen __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html