pacckages

if(!require(FSA)){install.packages("FSA")}
if(!require(psych)){install.packages("psych")}
if(!require(lme4)){install.packages("lme4")}
if(!require(lmerTest)){install.packages("lmerTest")}
if(!require(nlme)){install.packages("nlme")}
if(!require(car)){install.packages("car")}
#
library(googlesheets4); gs4_deauth()
library(AICcmodavg)
library(ggplot2)
library(lme4)
library(psych)

Efectos Fijos del MOdelo: Length ~ Hand

Un aov(), sin tomar en cuenta Individual nos dice que no hay diferencias entre el largo de las manos. Como se ve en la figura de arriba

aov <- aov(Length ~ Hand, data=hands)
summary(aov)
##             Df Sum Sq Mean Sq F value Pr(>F)
## Hand         1   0.45   0.451   0.117  0.734
## Residuals   30 115.27   3.842
##
p <- ggplot(data=hands,
            aes(x=Hand, y= Length, col=Individual ))
p +
  geom_point(size=3,position = position_jitter(width= 0.1, height=0))

Mixed Model: Length ~ Hand + (1|Individual)

Pero cuando se toma en cuenta el efecto aleatorio individuo. Se logra detectar que s[i hay diferencia entre el largo de la mano derecha y la izquierda

mixed.Model = lmer(Length ~ Hand + (1|Individual),
             data=hands, REML=TRUE)
anova(mixed.Model)
## Type III Analysis of Variance Table with Satterthwaite's method
##       Sum Sq Mean Sq NumDF DenDF F value   Pr(>F)   
## Hand 0.45125 0.45125     1    15  11.497 0.004034 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
mixed.Model.glm = glmer(Length ~ Hand + (1|Individual),
             data=hands)
## Warning in glmer(Length ~ Hand + (1 | Individual), data = hands): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(mixed.Model.glm)
## Linear mixed model fit by REML ['lmerMod']
## Formula: Length ~ Hand + (1 | Individual)
##    Data: hands
## 
## REML criterion at convergence: 72.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.39345 -0.49825 -0.05118  0.54100  1.31960 
## 
## Random effects:
##  Groups     Name        Variance Std.Dev.
##  Individual (Intercept) 3.80304  1.9501  
##  Residual               0.03925  0.1981  
## Number of obs: 32, groups:  Individual, 16
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept) 17.35625    0.49004  35.418
## HandRight    0.23750    0.07004   3.391
## 
## Correlation of Fixed Effects:
##           (Intr)
## HandRight -0.071