2
$\begingroup$

I made a linear mixed effect model using the mtcars datset with the following parameters:

IV: mtcars$am, DV: mtcars$disp, Controlling for mtcars$gear, mtcars$carb

Here is the model results itself:

Linear mixed model fit by maximum likelihood  ['lmerMod']
Formula: disp ~ am + (1 | gear) + (1 | carb)
    Data: mtcars
 
      AIC      BIC   logLik deviance df.resid 
    375.7    383.0   -182.8    365.7       27 
 
 Scaled residuals: 
      Min       1Q   Median       3Q      Max 
 -2.44542 -0.63575 -0.06279  0.51475  1.70509 
 
 Random effects:
  Groups   Name        Variance Std.Dev.
  carb     (Intercept) 4032     63.50   
  gear     (Intercept) 6960     83.43   
  Residual             3062     55.34   
 Number of obs: 32, groups:  carb, 6; gear, 3
 
Fixed effects:
             Estimate Std. Error t value
 (Intercept)   218.83      59.66   3.668
 mtcars$am     -12.32      34.51  -0.357
 
Correlation of Fixed Effects:
           (Intr)
 mtcars$am -0.325

Here is the p value analysis results:

 Analysis of Deviance Table (Type II Wald chisquare tests)
 
 Response: disp
 
            Chisq Df Pr(>Chisq)
 
 mtcars$am 0.1275  1     0.7211

According to these results, this model was not significant (χ² = 0.1275, p = 0.7211). When controling for mtcars$gear and mtcars$carb, when mtcars$am == 0 the mtcars$disp estimate is 218.83 and when mtcars$am == 1 the mtcars$disp estimate is 206.51 [218.83 + (-12.32) = 206.51], but these differences are not significantly different than one another (mtcars$am == 0 v. mtcars$am == 1).

Is my interpretation of the results correct?

Thanks ahead of time.


Here is the code I used to make the data:


# linear mixed effect model - IV: mtcars$am, DV: mtcars$disp, Controlling for mtcars$gear, mtcars$carb

## dataset of interest
mtcars

### colnames(mtcars)
colnames(mtcars)

### unique values for variable of interest
unique(mtcars$am)
unique(mtcars$disp)
unique(mtcars$gear)
unique(mtcars$carb)

## gives descriptives for mtcars$disp overall, mtcars__am_is_0$disp, and mtcars__am_is_1$disp

### loads psych package
library(psych)

#### for all data, mtcars$disp

##### loads tidyverse package
library(tidyverse)

##### nrow(mtcars)
nrow(mtcars)

##### description of 
describe(mtcars$disp)

#### for mtcars__am_is_1$disp

##### creates mtcars__am_is_1 object
mtcars__am_is_1 <- mtcars %>% filter(mtcars$am == 1)
mtcars__am_is_1 <- data.frame(mtcars__am_is_1)
mtcars__am_is_1
unique(mtcars__am_is_1$am)
nrow(mtcars__am_is_1)

##### description of 
describe(mtcars__am_is_1$disp)

#### for mtcars__am_is_0$disp

##### creates mtcars__am_is_0 object
mtcars__am_is_0 <- mtcars %>% filter(mtcars$am == 0)
mtcars__am_is_0 <- data.frame(mtcars__am_is_0)
mtcars__am_is_0
unique(mtcars__am_is_0$am)
nrow(mtcars__am_is_0)

##### description of 
describe(mtcars__am_is_0$disp)

## linear mixed effect model - IV: mtcars$am, DV: mtcars$disp, Controlling for mtcars$gear, mtcars$carb

### The code below loads the needed packages for the test
library(car)
library(MASS)
library(lme4)

### IV: mtcars$am, DV: mtcars$disp, Controlling for mtcars$gear, mtcars$carb
names(mtcars)
unique(mtcars$am)
unique(mtcars$disp)
unique(mtcars$gear)
unique(mtcars$carb)
lmem__IV_am__DV__disp__Controlling_for_gear_and_carb <- lmer(disp ~ am + (1 | gear) + (1 | carb), data = mtcars, REML = FALSE)
lmem__IV_am__DV__disp__Controlling_for_gear_and_carb__summary <- summary(lmem__IV_am__DV__disp__Controlling_for_gear_and_carb)
lmem__IV_am__DV__disp__Controlling_for_gear_and_carb__summary

### The code below uses anova to generate p values for the lmer code above
lmem__IV_am__DV__disp__Controlling_for_gear_and_carb__significance <- Anova(lmem__IV_am__DV__disp__Controlling_for_gear_and_carb)
lmem__IV_am__DV__disp__Controlling_for_gear_and_carb__significance

$\endgroup$
2
$\begingroup$

You seem to be quite pre-occupied by statistical significance. Please try not to worry too much about p-values and significance levels. The p-values are the probabilities of observing these data, or data more extreme, if and only if the null hypothesis is true, which is very often not understood by the analyst, and that is under the assumption that the relevant degrees of freedom (DF) are known precisely. In mixed effects models, there is considerable disagreement about how to calculate the (DF) for some of the tests. Often, it is possible to "approximate" the relevent DF, and this obviously implies that the p-values are also approximate. Therefore, any conclusion based on arbitrary thresholds, such as 0.05, could be wrong. The effect sizes are far more important than the p-values.

The model you have fitted specifies carb and gear as grouping factors for random intercepts. These have only 6 and 3 levels respectively. It might be possible to get away with 6, but 3 is too few to get a reasonable estimate for it's variance. gear should definitely be a fixed effect, not random.

Youre interpretation is correct, but again I would caution you not to worry too much about statistical significance.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.