[R] Bootstrap analysis from a conditional logistic regression
Nelly Reduan
nell.redu at hotmail.fr
Mon Nov 13 23:01:57 CET 2017
Nelly Reduan a partagé un fichier OneDrive avec vous. Pour lafficher, cliquez sur le lien ci-dessous.
<https://1drv.ms/u/s!Apkg2VlgfYyDgRAeVIM0nEajx0Fb>
[https://r1.res.office365.com/owa/prem/images/dc-png_20.png]<https://1drv.ms/u/s!Apkg2VlgfYyDgRAeVIM0nEajx0Fb>
Screenshot 2017-11-12 18.49.43.png<https://1drv.ms/u/s!Apkg2VlgfYyDgRAeVIM0nEajx0Fb>
Hello
How can I perform a bootstrap analysis from a conditional logistic regression? The model has been built using the `clogit` function (`survival` package)? The model has the following structure:
mod <- clogit(event ~ forest + log_area +forest:log_time + cluster(ID_individual) + strata(ID_strata), method = "efron", data = data , x=T, y=T)
Using bootstrapping, I would like to have a measure of uncertainty around the estimates of beta coefficients.
I am using the following code but I don't know how to consider strata and cluster arguments.
library(boot)
boot.clogit <- function(data, indices){
new_data <- data[indices,]
mod <- clogit(event ~ forest + log_area + forest:log_time + cluster(ID_individual) + strata(ID_strata),
method = "efron", data = new_data, x=T, y=T)
coefficients(mod)
}
boot_data <- boot(data=data, statistic=boot.clogit, R=5000)
I have attached an overview of my data set.
Thank you very much for your time.
Best regards,
Nell
[[alternative HTML version deleted]]
More information about the R-help
mailing list