[R] Help Interpreting Linear Mixed Model

John Kane jrkrideau at inbox.com
Mon Apr 27 23:43:06 CEST 2015


Hi Josh,

Just a sample  is usually  fine. As long as it cover a representative (must be time for dinner---I was going to type reprehensibe) sample of the data then something like dput(head(mydata, 100) ) works well.  

Kingston ON Canada

-----Original Message-----
From: joshuamichaeldixon at gmail.com
Sent: Mon, 27 Apr 2015 21:30:39 +0100
To: lists at dewey.myzen.co.uk
Subject: Re: [R] Help Interpreting Linear Mixed Model

Apologies for my ignorance!

Thierry - thank you for the reading.  I'll look into those ASAP!

John - The data set I have is quite large, when using the dput() command I'm unsure if it actually fits the whole output into the console.  I can't scroll up far enough to see the actual command.  I can paste what is there if that may help?  The bottom line: 

Names = c("Id", "Level", "AgeGr", "Position", "Height", "Weight", "BMI", "YoYo"), class = "data.frame", row.names = c(NA, -9689L))

Michael - Essentially, I'm looking for differences between "YoYo" outcome for "Positions", "Levels" and accounting for repeated measures using "Id" as a random factor.  So I was able to figure out points 2 and 3.

I've searched for definitions of "Scaled residuals", "Random effects", "Fixed effects", "Correlation of Fixed Effects".  However, I'm confused at the different interpretations I've found.  Or quite possibly, I'm just confused...  What should I be looking out for in these variables?

I've tried to take my analysis smaller, and just look at specifics, to make it simpler.  Such as, comparing YoYo (outcome score) for a Premier_League (Level), 22 (AgeGr) F (Position) with a Premier_League (Level), 22 (AgeGr) M (Position).  How do I convert these into a factors for analysis?

Simple question maybe, but it's not when you can't find the answer!

Thank you,

Josh

On Mon, Apr 27, 2015 at 4:10 PM, Michael Dewey <lists at dewey.myzen.co.uk> wrote:

	Dear Joshua

 It would also help if you told us what your scientific question was. At the moment we know what R commands you used and have seen the head of your dataset but not why you are doing it.

 I would summarise what you have given us as

 1 - most ID only occur once
 2 - goal keepers do worse than outfield players
 3 - older people (presumably in fact age is in years as a continuous variable) do better

 On 27/04/2015 12:42, John Kane wrote:

 John Kane
 Kingston ON Canada

	 -----Original Message-----
 From: joshuamichaeldixon at gmail.com
 Sent: Mon, 27 Apr 2015 08:54:51 +0100
 To: thierry.onkelinx at inbo.be
 Subject: Re: [R] Help Interpreting Linear Mixed Model

 Hello Thierry,

 No, this isn't homework. Not that young unfortunately.

 A few years ago a friend of mine and her daughter were neck-in-neck on who got their Ph.D first. What's this "not that young" business?

 BTW, a better way to supply sample data is to use the dput() command.

 Do a dput(mydata), copy the results into the email and you have supplied us with an exact copy of your data.

 It is possible for many reasons that I will not read in your data, as you supplied it, in the format you have it in.  This can lead to real confusion.

	 Josh

	 On 27 Apr 2015, at 08:06, Thierry Onkelinx <thierry.onkelinx at inbo.be>
 wrote:

 Dear Josh,

 Is this homework? Because the list has a no homework policy.

 Best regards,

 ir. Thierry Onkelinx
 Instituut voor natuur- en bosonderzoek / Research Institute for Nature
 and Forest
 team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
 Kliniekstraat 25
 1070 Anderlecht
 Belgium

 To call in the statistician after the experiment is done may be no more
 than asking him to perform a post-mortem examination: he may be able to
 say what the experiment died of. ~ Sir Ronald Aylmer Fisher
 The plural of anecdote is not data. ~ Roger Brinner
 The combination of some data and an aching desire for an answer does not
 ensure that a reasonable answer can be extracted from a given body of
 data. ~ John Tukey

 2015-04-27 2:26 GMT+02:00 Joshua Dixon <joshuamichaeldixon at gmail.com>:

	 Hello!

 Very new to R (10 days), and I've run the linear mixed model, below.
 Attempting to interpret what it means...  What do I need to look for?
 Residuals, correlations of fixed effects?!

 How would I look at very specific interactions, such as PREMIER_LEAGUE
 (Level) 18 (AgeGr) GK (Position) mean difference to CHAMPIONSHIP 18
 GK?

 For reference my data set looks like this:

 Id Level AgeGr   Position Height Weight BMI YoYo
 7451 CHAMPIONSHIP 14 M NA 63 NA 80
 148 PREMIER_LEAGUE 16 D NA 64 NA 80
 10393 CONFERENCE 10 D NA 36 NA 160
 10200 CHAMPIONSHIP 10 F NA 46 NA 160
 1961 LEAGUE_TWO 13 GK NA 67 NA 160
 10428 CHAMPIONSHIP 10 GK NA 40 NA 160
 10541 LEAGUE_ONE 10 F NA 25 NA 160
 10012 CHAMPIONSHIP 10 GK NA 30 NA 160
 9895 CHAMPIONSHIP 10 D NA 36 NA 160

 Many thanks in advance for time and help.  Really appreciate it.

 Josh

	 summary(lmer(YoYo~AgeGr+Position+(1|Id)))

 Linear mixed model fit by REML ['lmerMod']
 Formula: YoYo ~ AgeGr + Position + (1 | Id)

 REML criterion at convergence: 125712.2

 Scaled residuals:
      Min      1Q  Median      3Q     Max
 -3.4407 -0.5288 -0.0874  0.4531  4.8242

 Random effects:
   Groups   Name        Variance Std.Dev.
   Id       (Intercept) 15300    123.7
   Residual             16530    128.6
 Number of obs: 9609, groups:  Id, 6071

 Fixed effects:
               Estimate Std. Error t value
 (Intercept) -521.6985    16.8392  -30.98
 AgeGr         62.6786     0.9783   64.07
 PositionD    139.4682     7.8568   17.75
 PositionM    141.2227     7.7072   18.32
 PositionF    135.1241     8.1911   16.50

 Correlation of Fixed Effects:
            (Intr) AgeGr  PostnD PostnM
 AgeGr     -0.910
 PositionD -0.359 -0.009
 PositionM -0.375  0.001  0.810
 PositionF -0.349 -0.003  0.756  0.782

	 model=lmer(YoYo~AgeGr+Position+(1|Id))
 summary(glht(model,linfct=mcp(Position="Tukey")))

   Simultaneous Tests for General Linear Hypotheses

 Multiple Comparisons of Means: Tukey Contrasts

 Fit: lmer(formula = YoYo ~ AgeGr + Position + (1 | Id))

 Linear Hypotheses:
              Estimate Std. Error z value Pr(>|z|)
 D - GK == 0  139.468      7.857  17.751   <1e-04 ***
 M - GK == 0  141.223      7.707  18.323   <1e-04 ***
 F - GK == 0  135.124      8.191  16.496   <1e-04 ***
 M - D == 0     1.754      4.799   0.366    0.983
 F - D == 0    -4.344      5.616  -0.774    0.862
 F - M == 0    -6.099      5.267  -1.158    0.645
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
 (Adjusted p values reported -- single-step method)

          [[alternative HTML version deleted]]

 ______________________________________________
 R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help]
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html [http://www.R-project.org/posting-guide.html]
 and provide commented, minimal, self-contained, reproducible code.

         [[alternative HTML version deleted]]

 ______________________________________________
 R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help]
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html [http://www.R-project.org/posting-guide.html]
 and provide commented, minimal, self-contained, reproducible code.

 ____________________________________________________________
 FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
 Visit http://www.inbox.com/photosharing [http://www.inbox.com/photosharing] to find out more!

 ______________________________________________
 R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help]
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html [http://www.R-project.org/posting-guide.html]
 and provide commented, minimal, self-contained, reproducible code.

 -- 
 Michael
 http://www.dewey.myzen.co.uk/home.html [http://www.dewey.myzen.co.uk/home.html]

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.



More information about the R-help mailing list