extracting variance components from lm (Lee, Laura)

classic Classic list List threaded Threaded
1 message Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

extracting variance components from lm (Lee, Laura)

Carl Von Ende
Hi Laura,

To quote the Statsoft Electronic Textbook (Stats), “The basic goal of variance component estimation is to estimate the population covariation between random factors and the dependent variable.”

In using “lm,” you are assuming Station and Year are fixed factors.  Therefore, the only random component is the residual error term.

To estimate variance components, you must assume either Year or Station is fixed & the other factor random (= mixed model analysis), or that both Year & Station are random.  You will need to use nlme/lmm for the mixed or random analyses.

Also, re. your R code for the LM, it should be either Year * Station, or Year + Station + Year:Station.

See The R Book, 2nd ed., Michael J. Crawley, Chap. 19 – Mixed-Effect Models, for some examples.

Hope this helps?

Carl von Ende


On 7/22/17, 5:00 AM, "R-sig-ecology on behalf of [hidden email]" <[hidden email] on behalf of [hidden email]> wrote:

    Send R-sig-ecology mailing list submissions to
    [hidden email]
   
    To subscribe or unsubscribe via the World Wide Web, visit
    https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
    or, via email, send a message with subject or body 'help' to
    [hidden email]
   
    You can reach the person managing the list at
    [hidden email]
   
    When replying, please edit your Subject line so it is more specific
    than "Re: Contents of R-sig-ecology digest..."
   
   
    Today's Topics:
   
       1. extracting variance components from lm (Lee, Laura)
   
   
    ----------------------------------------------------------------------
   
    Message: 1
    Date: Fri, 21 Jul 2017 12:19:22 +0000
    From: "Lee, Laura" <[hidden email]>
    To: "'[hidden email]'" <[hidden email]>
    Subject: [R-sig-eco] extracting variance components from lm
    Message-ID:
    <[hidden email]>
   
    Content-Type: text/plain; charset="iso-8859-1"
   
    Hi all-
   
    I have a fairly simple model:
   
    m1 <- lm(Catch ~ Year + Station + Year*Station, data = data)
   
    I would like to extract the among years and year*station variance components and need assistance. I'm aware of the 'varComp' package, but I believe that only applies to nlme and requires a random effect. Any help is greatly appreciated. Thanks!
   
   
    Cheers,
   
    Laura
   
   
   
    Laura M. Lee
    Senior Stock Assessment Scientist
    Division of Marine Fisheries
    Department of Environmental Quality
   
    252 808 8094??? office
    252 726 6062??? fax
    mailto:[hidden email]
   
    3441 Arendell Street
    P.O. Box 769
    Morehead City, NC 28557-0769
   
   
   
    Email correspondence to and from this address is subject to the
    North Carolina Public Records Law and may be disclosed to third parties.
   
   
   
    ------------------------------
   
    Subject: Digest Footer
   
    _______________________________________________
    R-sig-ecology mailing list
    [hidden email]
    https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
   
    ------------------------------
   
    End of R-sig-ecology Digest, Vol 112, Issue 6
    *********************************************
   

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Loading...