[R] regression/step coefficients extraction

Hufkens Koen Koen.Hufkens at ua.ac.be
Mon Apr 10 16:25:57 CEST 2006

Hi list,

I'm looking for a way to easily extract regression p-values and export
them to one file for further evaluation.

Here is the problem.

I use lm() and step() to get my regression parameters/coefficients.

after that I can extract them with summary(lm-results)$coefficients[,4]

so far so good

but it seems that if a value is not significant it is dropped from the
table/matrix so the previous command yields no consistent results with
respect to the order of appearance.

so I can get p-values for one regression being:

a	b	c	d
.01	.01	.01	.01

and the next

a	b	d
.01	.01	.01

so it's not easy to match them up correctly, because these shifts in
order or the lack of NA or empty spaces.

I would like an output to text file in this form

independent parameters: a	b	c
p-values:			.01	.02	.01
				.01	NA	.01


Any ideas to get a nice (and easy) output file where the dropped values
are filled in with NA and keeping the order and labels ok... ?

Best regards,

More information about the R-help mailing list