[R] Jackknife in Logistic Regression

chuck.01 CharlieTheBrown77 at gmail.com
Thu Nov 15 05:13:34 CET 2012


untested, but something like this should get you what you want:

no.it <- 5
out <- vector("list", length=no.it)

      for(i in 1:no.it){
mydata2 <- mydata[ sample(1:nrow(mydata),  76000/no.it) ,]

out[[i]]  <-  coef(  
glm(f_ocur~altitud+UTM_X+UTM_Y+j_sin+j_cos+temp_res+pp+offset(log(1/off)),
data=mydata2, family='binomial')   )  

      }

do.call(c, out) 





Lucas wrote
> Dear R friends
> 
> I´m interested into apply a Jackknife analysis to in order to quantify the
> uncertainty of my coefficients estimated by the logistic regression. I´m
> using a glm(family=’binomial’) because my independent variable is in 0 - 1
> format.
> 
> My dataset has 76000 obs, and I´m using 7 independent variables plus an
> offset. The idea involves to split the data in let’s say 5 random subsets
> and then obtaining the 7 estimated parameters by dropping one subset at a
> time from the dataset. Then I can estimate uncertainty of the parameters.
> 
> I understand the procedure but I´m unable to do it in R.
> 
> This is the model that I´m
> fitting:*glm(f_ocur~altitud+UTM_X+UTM_Y+j_sin+j_cos+temp_res+pp+offset(log(1/off)),
> data=mydata, family='binomial')*
> 
> Does anyone have an idea of how can I make this possible?
> 
> I´d really appreciate if someone could help me with this.
> 
> Thank you in advance.
> 
> P.S. More information can be added if needed.
> 
> Best regards.
> 
> Lucas.
> 
> 	[[alternative HTML version deleted]]
> 
> 
> ______________________________________________

> R-help@

>  mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.





--
View this message in context: http://r.789695.n4.nabble.com/Jackknife-in-Logistic-Regression-tp4649520p4649563.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list