Hello, I am hoping someone can help me with the following multivariate issue: I have a model consisting of about 50 covariates. I would like to reduce this to about 5 covariate for the reduced model by combining cofactors that are strongly correlated. Is there a package or function that would help me with this in R? I appreciate any suggestions. Thanks, Ian
Hello Ian, ?princomp If your covariates are scalars, and the following documents: http://www.jstatsoft.org/v07/i01/drdoc.pdf http://www.bioconductor.org/workshops/Milan/PDF/Lab12.pdf Best wishes. Saludos, Juan Carlos Mart??nez Ovando Banco de M??xico Av. 5 de Mayo No. 18 Piso 5 Secci??n D Col. Centro 06059 M??xico, D. F. Tel. +52 55 52.37.20.00 ext. 3594 Fax. +52 55 52.37.27.03 e-mail: jcmartinez at banxico.org.mx -----Mensaje original----- De: Ian Fiske [mailto:ifiske at ufl.edu] Enviado el: Martes, 12 de Octubre de 2004 04:08 PM Para: r-help at stat.math.ethz.ch Asunto: [R] covariate selection? Hello, I am hoping someone can help me with the following multivariate issue: I have a model consisting of about 50 covariates. I would like to reduce this to about 5 covariate for the reduced model by combining cofactors that are strongly correlated. Is there a package or function that would help me with this in R? I appreciate any suggestions. Thanks, Ian ______________________________________________ R-help at 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
Have you considered stepwise regression, e.g., "step" or "stepAIC" in library(MASS)? The documentation for both contain examples. hope this helps. spencer graves Ian Fiske wrote:> Hello, > > I am hoping someone can help me with the following multivariate > issue: I have a model consisting of about 50 covariates. I would > like to reduce this to about 5 covariate for the reduced model by > combining cofactors that are strongly correlated. Is there a package > or function that would help me with this in R? I appreciate any > suggestions. > > Thanks, > Ian > > ______________________________________________ > R-help at 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 O: (408)938-4420; mobile: (408)655-4567
Hello Ian, Sorry. I don't really understand your problem, which is of model selection. That's right? You could use some criteria based in likelihood. For instante Akaike (AIC) or Schwarz criteria (BIC), see: ?AIC ?mle.aic (The best model is determined minimizing AIC or BIC). I hope this help you. Greetings, Juan Carlos -----Mensaje original----- De: Ian Fiske [mailto:ifiske at ufl.edu] Enviado el: Martes, 12 de Octubre de 2004 05:17 PM Para: Mart??nez Ovando Juan Carlos CC: r-help at stat.math.ethz.ch Asunto: Re: [R] covariate selection? Thanks Juan. I thought that was what I was looking for, but really, I want to know which of the original covariates could best be used to take advantage of their colinearity without creating new variables. I think PCA creates new variables. SAS and SPSS can do what I'm talking about, but I would like to use R for this. Thanks, Ian Mart??nez Ovando Juan Carlos wrote:>Hello Ian, > >?princomp > >If your covariates are scalars, and the following documents: > >http://www.jstatsoft.org/v07/i01/drdoc.pdf > >http://www.bioconductor.org/workshops/Milan/PDF/Lab12.pdf > > >Best wishes. > >Saludos, > >Juan Carlos Mart??nez Ovando >Banco de M??xico >Av. 5 de Mayo No. 18 >Piso 5 Secci??n D >Col. Centro >06059 M??xico, D. F. >Tel. +52 55 52.37.20.00 ext. 3594 >Fax. +52 55 52.37.27.03 >e-mail: jcmartinez at banxico.org.mx > > >-----Mensaje original----- >De: Ian Fiske [mailto:ifiske at ufl.edu] >Enviado el: Martes, 12 de Octubre de 2004 04:08 PM >Para: r-help at stat.math.ethz.ch >Asunto: [R] covariate selection? > >Hello, > >I am hoping someone can help me with the following multivariate issue: >I have a model consisting of about 50 covariates. I would like to >reduce this to about 5 covariate for the reduced model by combining >cofactors that are strongly correlated. Is there a package or function >that would help me with this in R? I appreciate any suggestions. > >Thanks, >Ian > >______________________________________________ >R-help at 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 > > > >
Ian Fiske wrote:> Hello, > > I am hoping someone can help me with the following multivariate > issue: I have a model consisting of about 50 covariates. I would > like to reduce this to about 5 covariate for the reduced model by > combining cofactors that are strongly correlated. Is there a package > or function that would help me with this in R? I appreciate any > suggestions. > > Thanks, > Ian > > ______________________________________________ > R-help at 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 > >have a look at package leaps, and also consider ridge regression. -- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra
I like Kjetil's suggestion of a shrinkage estimator. Perhaps this would be a good time to experiment with Trevor Hastie's 'lars' package. If you have a lot of correlated inputs I might suggest using Andy Liaw's randomforest package. I have found this technique to be very valuable in this setting. The partial dependency plots are a good way to explore the functional relationships of the variables. --Matt -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Kjetil Brinchmann Halvorsen Sent: Tuesday, October 12, 2004 17:16 PM To: Ian Fiske Cc: r-help at stat.math.ethz.ch Subject: Re: [R] covariate selection? Ian Fiske wrote:> Hello, > > I am hoping someone can help me with the following multivariate > issue: I have a model consisting of about 50 covariates. I would > like to reduce this to about 5 covariate for the reduced model by > combining cofactors that are strongly correlated. Is there a package > or function that would help me with this in R? I appreciate any > suggestions. > > Thanks, > Ian > > ______________________________________________ > R-help at 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 > >have a look at package leaps, and also consider ridge regression. -- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra ______________________________________________ R-help at 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