admin管理员组文章数量:1334704
I am using the lmertree function from the glmertree package to compare the effects of three contexts (levels of a factor called 'source') on acceleration.
Because visual inspection showed heteroscedasticity, I decided to log transform my dependent variable 'acceleration'. Though visual inspection shows improvement, I notice that leveneTest still points to a significant difference.
A colleague suggested using Brown–Forsythe test instead. We both tried but with different functions and obtained different results:
- Using the bf.test function from 'onewaytests', no significant difference is found.
- using the leveneTest while specifying the parameter 'center = median' still results in a significant difference.
I am wondering what is causing the difference between the two test results. Many thanks for your help!
Here is the code:
# Add a new column with log-transformed values of acceleration
CA_degrees_PT$log_acce_RHwri_norm_mean <- log(CA_degrees_PT$acce_RHwri_norm_mean)
log_acce_RHwri_norm_mean_lmertree <- lmertree(log_acce_RHwri_norm_mean ~ 1|duration_nFrames + (1|participant)|source , data = CA_degrees_PT)
plot(log_acce_RHwri_norm_mean_lmertree, which = "tree", gp = gpar(cex = .9))
hist(residuals(log_acce_RHwri_norm_mean_lmertree))
qqnorm(residuals(log_acce_RHwri_norm_mean_lmertree))
qqline(residuals(log_acce_RHwri_norm_mean_lmertree))
resids_log_acce <- residuals(log_acce_RHwri_norm_mean_lmertree)
preds_log_acce <- predict(log_acce_RHwri_norm_mean_lmertree)
plot(CA_degrees_PT$source, resids_log_acce)
leveneTest(resids_log_acce ~ groups, center = median)
bf.test(resids_log_acce ~ groups, data = CA_degrees_PT)
本文标签:
版权声明:本文标题:r - Why does Brown-Forsythe test return different results in bf.test (onewaytests) and leveneTest(..., center = median)? - Stack 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742372738a2462553.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论