[R] Nested Models
peter dalgaard
pdalgd at gmail.com
Thu Jul 26 10:16:02 CEST 2012
On Jul 26, 2012, at 09:07 , Rolf Turner wrote:
>
> Homework? Ask your prof.
Not necessarily, Rolf. Project work perhaps, but could also be completely extracurricular (knows theory and textbook notation, now has a real data set). I think a few hints could be in order:
(a) Figure out how to find the SSE and the MSE in _any_ linear model. Use a textbook example and match things up with the R notation (hint: lm(), anova(), summary()).
(b) Figure out how to specify the two models that you want to compare (hint: y~x+I(x^2)). Again, look for a similar textbook example and compare.
(c) Done. You can however go a little further and get R to compare the two models directly (revisit the help for anova()).
-pd
> cheers,
>
> Rolf Turner
>
> On 26/07/12 11:48, stuco wrote:
>> Hey, I'm an R noobie and I have been trying calculate SSEr and SSEc in order
>> to determine if there is sufficient evidence to include second-order terms
>> in my model, but I have no idea what command to use. Any help with this
>> would be much appreciated.
>
> ______________________________________________
> 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.
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-help
mailing list