R Markdown
Hi folks
I'm trying to do a post-hoc test with the glht() function from the multcomp package. I receive an unexptected symbol error and I don't understand why.
Please find the example of the dataframe which should reproduce the error. It's my first question here and please forgive me if I didn't get the reprex perfect.
Many thanks in advance!
df1 <- data.frame(credit_amount = c(1169,5951,20960,78820,4870,9055,2835,6948,3059,5234),
job = as.factor(c("skilled","skilled",
"unskilled resident","skilled","skilled",
"unskilled resident","skilled",
"high qualif/self emp/mgmt",
"unskilled resident",
"high qualif/self emp/mgmt"))
)
lm.credit <- lm(credit_amount ~ job, data = df1)
library(multcomp)
ph.test.1 <- glht(model = lm.credit,
linfct = mcp(job = c("unskilled resident - skilled = 0")))
summary(ph.test.1)