































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
































































library(nlme) place.small<-data.frame(good=place.s$good1, dist=place.s$dist) place.sum<-gsummary(object = place.small, FUN = sum, groups = place.small$dist) place.length<-gsummary(object = place.small, FUN = length, groups = place.small$dist) place.pattern <- data.frame(y = place.sum$good, fail = place.length$good - place.sum$good, n = place.length$good, distance = place.sum$dist)
place.pattern y fail n distance 1 2 1 3 18 2 7 0 7 19 3 776 13 789 20 4 19 1 20 21 5 12 2 14 22 6 26 1 27 23 7 7 0 7 24 8 12 1 13 25 9 8 1 9 26 10 24 5 29 27 11 20 2 22 28 12 16 1 17 29 13 12 2 14 30 14 10 1 11 31 15 23 7 30 32 16 20 1 21 33
mod.fit <- glm(formula = y/n ~ distance, data = place.pattern, weight = n, family = binomial(link = logit), na.action = na.exclude, control = list(epsilon = 0.0001, maxit = 50, trace = T)) Deviance = 47.12782 Iterations - 1 Deviance = 44.52325 Iterations - 2 Deviance = 44.49945 Iterations - 3 Deviance = 44.49945 Iterations - 4 summary(mod.fit) Call: glm(formula = y/n ~ distance, family = binomial(link = logit), data = place.pattern, weights = n, na.action = na.exclude, control = list(epsilon = 1e-04, maxit = 50, trace = T)) Deviance Residuals: Min 1Q Median 3Q Max -2.0373 -0.6449 -0.1424 0.5004 2. Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 5.812080 0.326245 17.82 <2e-16 *** distance -0.115027 0.008338 -13.80 <2e-16 ***
Signif. codes: 0 ***' 0.001**' 0.01 *' 0.05.' 0.1 ` ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 282.181 on 42 degrees of freedom Residual deviance: 44.499 on 41 degrees of freedom AIC: 148. Number of Fisher Scoring iterations: 4
th
2
2
2
mod.fit <- glm(formula = y/n ~ distance, data = place.pattern, weight = n, family = binomial(link = logit), na.action = na.exclude, control = list(epsilon = 0.0001, maxit = 50, trace = T)) GLM linear loop 1: deviance = 173.
GLM linear loop 2: deviance = 60. GLM linear loop 3: deviance = 45. GLM linear loop 4: deviance = 44. GLM linear loop 5: deviance = 44.
0 10 20 30 40 0 5 10 15 20 25 Delta.beta vs. j j (explanatory variable pattern number) Delta.beta 0.2 0.4 0.6 0.8 1. 0 5 10 15 20 25 Delta.beta vs. pred. prob. Predicted probabilities Delta.beta 3 0.2 0.4 0.6 0.8 1. 0 5 10 15 Sq. standardized residuals vs. pred. prob. with plot point proportion to delta.beta Predicted probabilities Sq. standardized residuals X^2 = 56.11 with p-value = 0. G^2= 44.5 with p-value = 0.
20 30 40 50 60
0 2 Standardized Pearson residuals vs. Distance Distance Adj. Pearson residuals
10 20 30 40 50 60
Distance (yards) Estimated probability