From: r user <ruser2006_at_yahoo.com>

Date: Wed 16 Aug 2006 - 00:01:13 EST

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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Aug 16 00:07:18 2006

Date: Wed 16 Aug 2006 - 00:01:13 EST

Is there a way to get the following code to include
NA values where the coefficients are “NA”?

explanation:

Using a loop, I am running regressions on several “subsets” of “data1”.

“reg <- ( lm(lm(data1[,1] ~., data1[,2:l])) )”

I successfully extract the coefficients using the
following code:

“reg$coefficients”

I attempt to extract the standard errors using :

aperm((summary(reg))$coefficients)[2,]

((summary(reg))$coefficients)

My problem:

For some of my subsets, I am missing data for one or
more of the independent variables. This of course
causes the coefficients and standard erros for this
variable to be “NA”.

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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Aug 16 00:07:18 2006

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.1.8, at Wed 16 Aug 2006 - 02:22:37 EST.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*