Supplement 1. R code demonstrating how to fit a logistic regression model, with a random intercept term, and how to use resampling-based hypothesis testing for inference.
收藏figshare.com2023-06-01 更新2025-03-25 收录
下载链接:
https://figshare.com/articles/dataset/Supplement_1_R_code_demonstrating_how_to_fit_a_logistic_regression_model_with_a_random_intercept_term_and_how_to_use_resampling-based_hypothesis_testing_for_inference_/3550407/1
下载链接
链接失效反馈官方服务:
资源简介:
File List
glmmeg.R: R code demonstrating how to fit a logistic regression model, with a random intercept term, to randomly generated overdispersed binomial data.
boot.glmm.R: R code for estimating P-values by applying the bootstrap to a GLMM likelihood ratio statistic.
Description
glmm.R is some example R code which show how to fit a logistic regression model (with or without a random effects term) and use diagnostic plots to check the fit. The code is run on some randomly generated data, which are generated in such a way that overdispersion is evident. This code could be directly applied for your own analyses if you read into R a data.frame called “dataset”, which has columns labelled “success” and “failure” (for number of binomial successes and failures), “species” (a label for the different rows in the dataset), and where we want to test for the effect of some predictor variable called “location”. In other cases, just change the labels and formula as appropriate.
boot.glmm.R extends glmm.R by using bootstrapping to calculate P-values in a way that provides better control of Type I error in small samples. It accepts data in the same form as that generated in glmm.R.
文件列表
glmmeg.R: R语言代码示例,展示了如何对随机生成的过度离散的二项分布数据拟合逻辑回归模型,并包含随机截距项。
boot.glmm.R: 通过对GLMM似然比统计量应用自助法来估计P值的R代码。
描述
glmm.R是某些示例R代码,展示了如何拟合逻辑回归模型(包含或不包含随机效应项),并使用诊断图来检查拟合情况。该代码在随机生成数据上运行,这些数据是以显示过度离散的方式生成的。如果您在R中读取一个名为“dataset”的数据框,该数据框具有标记为“success”和“failure”的列(表示二项成功和失败的数量)、“species”列(数据集中不同行的标签),并希望测试某个预测变量“location”的影响,则可以直接将此代码应用于您自己的分析。在其他情况下,只需根据需要更改标签和公式。
boot.glmm.R通过使用自助法来计算P值,从而扩展了glmm.R,以在样本量较小的情况下提供对第一类错误的更好控制。它接受与glmm.R生成相同形式的数据。
提供机构:
figshare.com



