Frank Duan
2004-Oct-04 02:57 UTC
[R] Could anyone tell me how to extract pvalue from "lm" fitting?
Dear R people, I have a naive question: after fitting "lm" to a data, I can't extract the pvalue corresponding to a specific covariate in a direct way. Could anyone give me a hint? Thank you very much. Frank
Andrew Robinson
2004-Oct-04 03:18 UTC
[R] Could anyone tell me how to extract pvalue from "lm" fitting?
Frank, try the following, not all of which are directly relevant, but which explain the approach. If your lm is called "my.lm": names(summary(my.lm)) coefficients(summary(my.lm)) class(coefficients(summary(my.lm))) coefficients(summary(my.lm))[,4] I hope that this helps. Andrew On Sun, Oct 03, 2004 at 10:57:47PM -0400, Frank Duan wrote:> Dear R people, > > I have a naive question: after fitting "lm" to a data, I can't extract > the pvalue corresponding to a specific covariate in a direct way. > Could anyone give me a hint? > > Thank you very much. > > Frank > > ______________________________________________ > 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-- Andrew Robinson Ph: 208 885 7115 Department of Forest Resources Fa: 208 885 6226 University of Idaho E : andrewr at uidaho.edu PO Box 441133 W : http://www.uidaho.edu/~andrewr Moscow ID 83843 Or: http://www.biometrics.uidaho.edu No statement above necessarily represents my employer's opinion.