Skip to main content
added 46 characters in body
Source Link

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values; Explanatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF); individual as a random effect variable

After running a lmer function, and checking the assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB. How do I write this in R??

CODE IS AS FOLLOWS

#Model:
m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos)
summary(m1)

#Checking asusmptions: OK 

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

Thanks everyone for the help provided!

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values; Explanatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF); individual as a random effect variable

After running a lmer function, and checking the assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB. How do I write this in R??

CODE IS AS FOLLOWS

#Model:
m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos)
summary(m1)

#Checking asusmptions: OK 

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values; Explanatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF); individual as a random effect variable

After running a lmer function, and checking the assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB. How do I write this in R??

CODE IS AS FOLLOWS

#Model:
m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos)
summary(m1)

#Checking asusmptions: OK 

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

Thanks everyone for the help provided!

deleted 328 characters in body
Source Link

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values; Explanatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF); individual as a random effect variable

After running a lmer function, and checking the assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB. How do I write this in R??

CODE IS AS FOLLOWS #Model: m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos) summary(m1)

e1<-resid(m1) #Model:
pre1<-predict(m1) 

windows()
par(mfrow = c(1,<- 2))
plotlmer(pre1, e1, xlab="Predichos", ylab="Residuos de pearson",main="Gráfico de                     
dispersiónVueltasmin de~ RECondicion vs+ PRED",cex.main=.8(1 )| 
abline(0,0Bicho)
qqnorm(e1, cex.main=.9Datos)   #QQ plot
qqlinesummary(e1m1)
par(mfrow = c(1, 1))
shapiro.test(e1) #Checking asusmptions: OK 

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values; Explanatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF); individual as a random effect variable

After running a lmer function, and checking the assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB. How do I write this in R??

CODE IS AS FOLLOWS #Model: m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos) summary(m1)

e1<-resid(m1) 
pre1<-predict(m1) 

windows()
par(mfrow = c(1, 2))
plot(pre1, e1, xlab="Predichos", ylab="Residuos de pearson",main="Gráfico de                     
dispersión de RE vs PRED",cex.main=.8 ) 
abline(0,0)
qqnorm(e1, cex.main=.9)   #QQ plot
qqline(e1)
par(mfrow = c(1, 1))
shapiro.test(e1)    

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values; Explanatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF); individual as a random effect variable

After running a lmer function, and checking the assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB. How do I write this in R??

CODE IS AS FOLLOWS

#Model:
m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos)
summary(m1)

#Checking asusmptions: OK 

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

edited title
Source Link
Michael R. Chernick
  • 43.2k
  • 28
  • 85
  • 159

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values**;**with positive, negative and zero values; ExplicatoryExplanatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF)**;**individual as a random effect variable(DB, DF, NDB, NDF, BB, BF); individual as a random effect variable

After running a lmer function, and checking forthe assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB, how. How do I write that in the scriptthis in R??

THANKS!

CODE IS AS FOLLOWS #Model: m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos) summary(m1)

e1<-resid(m1) 
pre1<-predict(m1) 

windows()
par(mfrow = c(1, 2))
plot(pre1, e1, xlab="Predichos", ylab="Residuos de pearson",main="Gráfico de                     
dispersión de RE vs PRED",cex.main=.8 ) 
abline(0,0)
qqnorm(e1, cex.main=.9)   #QQ plot
qqline(e1)
par(mfrow = c(1, 1))
shapiro.test(e1)    

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values**;** Explicatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF)**;**individual as a random effect variable

After running a lmer function, and checking for assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB, how do I write that in the script in R??

THANKS!

CODE IS AS FOLLOWS #Model: m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos) summary(m1)

e1<-resid(m1) 
pre1<-predict(m1) 

windows()
par(mfrow = c(1, 2))
plot(pre1, e1, xlab="Predichos", ylab="Residuos de pearson",main="Gráfico de                     
dispersión de RE vs PRED",cex.main=.8 ) 
abline(0,0)
qqnorm(e1, cex.main=.9)   #QQ plot
qqline(e1)
par(mfrow = c(1, 1))
shapiro.test(e1)    

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

I´ve run a GLMM model with the following variables: Response variable: continuous (with positive, negative and zero values; Explanatory variable: 1 factor with 6 levels (DB, DF, NDB, NDF, BB, BF); individual as a random effect variable

After running a lmer function, and checking the assumptions, I want to perform a posteriori specific comparisons. How do I do that? I want to test for example if there is any difference between DF vs. DB. How do I write this in R??

CODE IS AS FOLLOWS #Model: m1 <- lmer(Vueltasmin ~ Condicion + (1 | Bicho), Datos) summary(m1)

e1<-resid(m1) 
pre1<-predict(m1) 

windows()
par(mfrow = c(1, 2))
plot(pre1, e1, xlab="Predichos", ylab="Residuos de pearson",main="Gráfico de                     
dispersión de RE vs PRED",cex.main=.8 ) 
abline(0,0)
qqnorm(e1, cex.main=.9)   #QQ plot
qqline(e1)
par(mfrow = c(1, 1))
shapiro.test(e1)    

#Comparisons:
model.matrix.gls <- function(object, ...) {
  model.matrix(terms(object), data = getData(object), ...)
}
model.frame.gls <- function(object, ...) {
model.frame(formula(object), data = getData(object), ...)
}
terms.gls <- function(object, ...) {
  terms(model.frame(object), ...)
}


#Comparisons desired:
#DB-DF
#NDB-NDF
#BB-BF
#DB-BB

Here I show how the data plot looks like, and the comparisons desired. enter image description here

edited title
Link
Michael R. Chernick
  • 43.2k
  • 28
  • 85
  • 159
Loading
Source Link
Loading