[R] Linear Regression Problem

Vito Muggeo (UniPa) vito.muggeo at unipa.it
Tue Jul 14 17:18:34 CEST 2009


dear Alex,
I think your problem with a large number of predictors and a relatively 
small number of subjects may be faced via some regularization approach 
(ridge or lasso regression..)

hope this helps you,
vito

Alex Roy ha scritto:
> Dear All,
>                  I have a matrix  say, X ( 100 X 40,000) and a vector say, y
> (100 X 1) . I want to perform linear regression. I have scaled  X matrix by
> using scale () to get mean zero and s.d 1  . But still I get very high
> values of regression coefficients.  If I scale X matrix, then the regression
> coefficients will bahave as a correlation coefficient and they should not be
> more than 1. Am I right? I do not whats going wrong.
> Thanks for your help.
> Alex
> 
> 
> *Code:*
> 
> UniBeta <- sapply(1:dim(X)[2], function(k)
> + summary(lm(y~X[,k]))$coefficients[2,1])
> 
> pval <- sapply(1:dim(X)[2], function(l)
> + summary(lm(y~X[,l]))$coefficients[2,4])
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

-- 
====================================
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 6626240
fax: 091 485726/485612
http://dssm.unipa.it/vmuggeo




More information about the R-help mailing list