[R] extracting significance test for individual lm() parameters after using by

David Winsemius dwinsemius at comcast.net
Sun Jan 25 23:11:36 CET 2015

On Jan 24, 2015, at 11:02 PM, Moxley, Jerad wrote:

> Sorry I was not clearer, but I was asking an R programming question not a theory question.

Copying back the original text which appears to have been omitted:

On 25/01/2015 02:01, Moxley, Jerad wrote:
> I’m trying to test what growth functions best fit individual subjects. I’m wanting compare linear, quadratic, cubic etc.  Here is the example from the cubic curve.
> b3a<-by(c,id,function(x) lm(w~agec+ageq+agecub,data=x))

> I will try to clarify. If I did this analysis with a dataset involving  just one subject the summary command on the lm object would give me a significance test on each parameter fit. The question in this cSe, is the cubic parameter significant?

It's not really true that you are "not asking a theory question". You do want inferences. A further problem might be that people who do statistics regularly would not be making statistical inferences based on naive construction of squared and cubed values. I suspect most readers would rather not comment on a procedure that seems particularly prone to invalid results.


> When I try to do this for each subject separately in a larger dataset using the by command, I get the parameter estimate but can't find a significance test. I apologize again for my poor explanation originally, 

>> On Jan 24, 2015, at 10:04 PM, Jeff Newmiller <jdnewmil at dcn.davis.CA.us> wrote:
>> R-square is often a poor indicator of whether a model is appropriate or not. While it is possible that there exists a package that implements your algorithm (which you might find using the sos package), I would recommend that you get some advice from an expert on how to approach this subject, and this list is not a good place for studying statistics theory (read the Posting Guide). You might try stats.stackexchange. com. 
>> ---------------------------------------------------------------------------
>> Jeff Newmiller                        The     .....       .....  Go Live...

David Winsemius
Alameda, CA, USA

More information about the R-help mailing list