Re: [R] Problem with read.spss() and as.data.frame(), or: alternative to subset()?
On Fri, 23 Sep 2005, Thomas Lumley wrote: On Wed, 21 Sep 2005, Martin Maechler wrote: Dirk == Dirk Enzmann [EMAIL PROTECTED] on Wed, 21 Sep 2005 13:18:32 +0200 writes: Dirk The selection problem can be solved by Dirk dr2000=read.spss('myfile') Dirk d=lapply(dr2000,subset,dr2000$RBINZ99 0) Dirk however, there is still the problem that R crashes when using Dirk d = as.data.frame(dr2000) which is bug in a R, or at least in your R installation. However we can't do anything about it at the moment, because we can't even try to do reproduce it... I suspect this is the same stack overflow in coerce.c:substituteList that was reported in PR#8141 Apparently not (it had only about 1500 columns rather than 198000). After taking it offline I was able to make it work on 1Gb machines under Windows and Linux, and Dirk succeeded using --max-mem-size=640M on Windows. So it looks like it was a problem with total memory usage - I have yet to find out what exactly. -- 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] Alternative to nlm()
Marion Wittmann mwittmann at bren.ucsb.edu writes: I am using the nlm function in a minimization exercise but have consistently received the code: last global step failed to locate a point lower than 'estimate' .. So it seems that this function is only finding a local minimum, not necessarily a global minimum. ... Try ?optim which has a few methods with a somewhat broader scope. 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
Re: [R] Are least-squares means useful or appropriate?
Dear Peter, Doug, and Felipe, My effects package (on CRAN, also see the article at http://www.jstatsoft.org/counter.php?id=75url=v08/i15/effect-displays-revis ed.pdf) will compute and graph adjusted effects of various kinds for linear and generalized linear models -- generalizing so-called least-squares means (or population marginal means or adjusted means). A couple of comments: By default, the all.effects() function in the effects package computes effects for high-order terms in the model, absorbing terms marginal to them. You can ask the effect() function to compute an effect for a term that's marginal to a higher-order term, and it will do so with a warning, but this is rarely sensible. Peter's mention of floating variances (or quasi-variances) in this context is interesting, but what would most like to see, I think, are the quasi-variances for the adjusted effects, that is for terms merged with their lower-order relatives. These, for example, are unaffected by contrast coding. How to define reasonable quasi-variances in this context has been puzzling me for a while. Regards, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard Sent: Friday, September 23, 2005 10:23 AM To: Douglas Bates Cc: Felipe; R-help@stat.math.ethz.ch Subject: Re: [R] Are least-squares means useful or appropriate? Douglas Bates [EMAIL PROTECTED] writes: On 9/20/05, Felipe [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. My question was just theoric. I was wondering if someone who were using SAS and R could give me their opinion on the topic. I was trying to use least-squares means for comparison in R, but then I found some indications against them, and I wanted to know if they had good basis (as I told earlier, they were not much detailed). Greetings. Felipe As Deepayan said in his reply, the concept of least squares means is associated with SAS and is not generally part of the theory of linear models in statistics. My vague understanding of these (I too am not a SAS user) is that they are an attempt to estimate the mean response for a particular level of a factor in a model in which that factor has a non-ignorable interaction with another factor. There is no clearly acceptable definition of such a thing. (PD goes and fetches the SAS manual) Well, yes. it'll do that too, although only if you ask for the lsmeans of A when an interaction like A*B is present in the model. This is related to the tests of main effects when an interaction is present using type III sums of squares, which has been beaten to death repeatedly on the list. In both cases, there seems to be an implicit assumption that categorical variables by nature comes from an underlying fully balanced design. If the interaction is absent from the model, the lsmeans are somewhat more sensible in that they at least reproduce the parameter estimates as contrasts between different groups. All continuous variables in the design will be set to their mean, but values for categorical design variables are weighted inversely as the number of groups. So if you're doing an lsmeans of lung function by smoking adjusted for age and sex you get estimates for the mean of a population of which everyone has the same age and half are male and half are female. This makes some sense, but if you do it for sex adjusting for smoking and age, you are not only forcing the sexes to smoke equally much, but actually adjusting to smoking rates of 50%, which could be quite far from reality. The whole operation really seems to revolve around 2 things: (1) pairwise comparisons between factor levels. This can alternatively be done fairly easily using parameter estimates for the relevant variable and associated covariances. You don't really need all the mumbo-jumbo of adjusting to particular values of other variables. (2) plotting effects of a factor with error bars as if they were simple group means. This has some merit since the standard parametrizations are misleading at times (e.g. if you choose the group with the least data as the reference level, std. err. for the other groups will seem high). However, it seems to me that concepts like floating variances (see float() in the Epi package) are more to the point. R is an interactive language where it is a simple matter to fit a series of models and base your analysis on a model that is appropriate. An approach of give me the answer to any possible question about this model, whether or not it make sense is unnecessary. In many ways statistical
[R] rpart Error in yval[, 1] : incorrect number of dimensions
I tried using rpart, as below, and got this error message rpart Error in yval[, 1] : incorrect number of dimensions. Thinking it might somehow be related to the large number of missing values, I tried using complete data, but with the same result. Does anyone know what may be going on, and how to fix it? I have traced two similar error messages in the Archive, but following the threads did not make it clear how to fix the problem. currwh.rpart-rpart(formula = CURRWHEE~EA17_6_1 + EA17_9_1 + X087 + X148 + X260 + MOTHERSA + GESTATIO,method=class) currwh.rpart n=6783 (2283 observations deleted due to missing) node), split, n, loss, yval, (yprob) * denotes terminal node 1) root 6783 720 3 (0.1060002949 0.8938522778 0.0001474274) * summary(currwh.rpart) Call: rpart(formula = CURRWHEE ~ EA17_6_1 + EA17_9_1 + X087 + X148 + X260 + MOTHERSA + GESTATIO, method = class) n=6783 (2283 observations deleted due to missing) CP nsplit rel error 1 0 0 1 Error in yval[, 1] : incorrect number of dimensions [[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] rpart Error in yval[, 1] : incorrect number of dimensions
I tried using rpart, as below, and got this error message rpart Error in yval[, 1] : incorrect number of dimensions. Thinking it might somehow be related to the large number of missing values, I tried using complete data, but with the same result. Does anyone know what may be going on, and how to fix it? I have traced two similar error messages in the Archive, but following the threads did not make it clear how to fix the problem. currwh.rpart-rpart(formula = CURRWHEE~EA17_6_1 + EA17_9_1 + X087 + X148 + X260 + MOTHERSA + GESTATIO,method=class) currwh.rpart n=6783 (2283 observations deleted due to missing) node), split, n, loss, yval, (yprob) * denotes terminal node 1) root 6783 720 3 (0.1060002949 0.8938522778 0.0001474274) * summary(currwh.rpart) Call: rpart(formula = CURRWHEE ~ EA17_6_1 + EA17_9_1 + X087 + X148 + X260 + MOTHERSA + GESTATIO, method = class) n=6783 (2283 observations deleted due to missing) CP nsplit rel error 1 0 0 1 Error in yval[, 1] : incorrect number of dimensions [[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] Legend out of Plot Region
Hi, Could someone tell me how to place a legend outside the plot region? Thanks, Mike __ 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] Are least-squares means useful or appropriate?
On 9/20/05, Felipe [EMAIL PROTECTED] wrote: My question was just theoric. I was wondering if someone who were using SAS and R could give me their opinion on the topic. I was trying to use least-squares means for comparison in R, but then I found some indications against them, and I wanted to know if they had good basis (as I told earlier, they were not much detailed). You may find this page helpful: http://www.tufts.edu/~gdallal/LHSP.HTM. The author claims that least-squares means is just a weird SAS word for adjusted means, and discusses several advantages and disadvantages. JD __ 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] Legend out of Plot Region
Le 24.09.2005 20:22, Michel Friesenhahn a écrit : Hi, Could someone tell me how to place a legend outside the plot region? Thanks, Mike Hi Mike, Take a look at : R par(xpd=NA) -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques ~ ~~ Romain FRANCOIS - http://addictedtor.free.fr ~~ Etudiant ISUP - CS3 - Industrie et Services ~~http://www.isup.cicrp.jussieu.fr/ ~~ Stagiaire INRIA Futurs - Equipe SELECT ~~ http://www.inria.fr/recherche/equipes/select.fr.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] Install and load packages
Dear R-users, I would like to know what are the commands to install (from a local zip file) a package and then to load it. Thaks all, Bests, Caio Perco a consciencia, mas não importa, encontro a maior serenidade na alucinaçao. É curioso como não sei dizer quem sou. Quer dizer, sei-o bem, mas não posso dizer. Sobretudo tenho medo de dizer, porque no momento em que tento falar, não só não exprimo o que sinto como o que sinto se transforma lentamente no que eu digo. - Perto do coraçao selvagem, Clarice Lispector Quando você não conseguir olhar dentro da alma de alguém, se afaste. Vá embora e depois de um tempo volte. - Boris Pasternak /##\ * Caio Lucidius Naberezny Azevedo * Estudante de Doutorado - IME-USP *** *** Orientador : Prof. Dr. Dalton Andrade *** Área de Pesquisa : Modelos de Resposta ao Item *** \##/ __ [[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] Install and load packages
Dear R-users, I would like to know what are the commands to install (from a local zip file) a package and then to load it. Thaks all, Bests, Caio Perco a consciencia, mas não importa, encontro a maior serenidade na alucinaçao. É curioso como não sei dizer quem sou. Quer dizer, sei-o bem, mas não posso dizer. Sobretudo tenho medo de dizer, porque no momento em que tento falar, não só não exprimo o que sinto como o que sinto se transforma lentamente no que eu digo. - Perto do coraçao selvagem, Clarice Lispector Quando você não conseguir olhar dentro da alma de alguém, se afaste. Vá embora e depois de um tempo volte. - Boris Pasternak /##\ * Caio Lucidius Naberezny Azevedo * Estudante de Doutorado - IME-USP *** *** Orientador : Prof. Dr. Dalton Andrade *** Área de Pesquisa : Modelos de Resposta ao Item *** \##/ - [[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] a question on proximity measurement in randomForest
Hi, I happened to have a question on the prox measure in rf: I guess the splitting in tree growing when running in an unsupervised mode has to be totally random (i.e. mtry=1 and splitting value is randomly selected) but I am not sure if the guessing is correct. But if the class label is available, should rf grow trees in a classification way so that it can give a better measure on prox? thanks for your comments, Weiwei -- Weiwei Shi, Ph.D Did you always know? No, I did not. But I believed... ---Matrix III [[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] Install and load packages
Caio Lucidius Naberezny Azevedo wrote: Dear R-users, I would like to know what are the commands to install (from a local zip file) a package and then to load it. On what system? On Windows, the easiest way is to use the menu: Packages | Install package(s) from local zip files 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
Re: [R] Install and load packages
(Oops, wasn't quite done when I sent the last one.) Caio Lucidius Naberezny Azevedo wrote: Dear R-users, I would like to know what are the commands to install (from a local zip file) a package and then to load it. On what system? On Windows, the easiest way is to use the menu: Packages | Install package(s) from local zip files then Packages | Load package... There are command line versions of both of those. 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