logit_analysis
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
logit_analysis [2019/09/15 02:41] – created hkimscil | logit_analysis [2019/09/15 02:54] – hkimscil | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | https:// | ||
< | < | ||
mydata <- read.csv(" | mydata <- read.csv(" | ||
Line 43: | Line 44: | ||
< | < | ||
- | < | + | <code>> xtabs(~admit + rank, data = mydata) |
rank | rank | ||
admit 1 2 3 4 | admit 1 2 3 4 | ||
Line 49: | Line 50: | ||
1 33 54 28 12 | 1 33 54 28 12 | ||
</ | </ | ||
+ | |||
+ | < | ||
+ | mylogit <- glm(admit ~ gre + gpa + rank, data = mydata, family = " | ||
+ | summary(mylogit) | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Call: | ||
+ | glm(formula = admit ~ gre + gpa + rank, family = " | ||
+ | data = mydata) | ||
+ | |||
+ | Deviance Residuals: | ||
+ | Min | ||
+ | -1.6268 | ||
+ | |||
+ | Coefficients: | ||
+ | | ||
+ | (Intercept) -3.989979 | ||
+ | gre 0.002264 | ||
+ | gpa 0.804038 | ||
+ | rank2 | ||
+ | rank3 | ||
+ | rank4 | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | (Dispersion parameter for binomial family taken to be 1) | ||
+ | |||
+ | Null deviance: 499.98 | ||
+ | Residual deviance: 458.52 | ||
+ | AIC: 470.52 | ||
+ | |||
+ | Number of Fisher Scoring iterations: 4 | ||
+ | |||
+ | > </ | ||
+ | |||
+ | < | ||
+ | > confint(mylogit) | ||
+ | Waiting for profiling to be done... | ||
+ | 2.5 % 97.5 % | ||
+ | (Intercept) -6.2716202334 -1.792547080 | ||
+ | gre 0.0001375921 | ||
+ | gpa 0.1602959439 | ||
+ | rank2 | ||
+ | rank3 | ||
+ | rank4 | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | > confint.default(mylogit) | ||
+ | 2.5 % 97.5 % | ||
+ | (Intercept) -6.2242418514 -1.755716295 | ||
+ | gre 0.0001202298 | ||
+ | gpa 0.1536836760 | ||
+ | rank2 | ||
+ | rank3 | ||
+ | rank4 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | wald.test(b = coef(mylogit), | ||
+ | </ | ||
+ | |||
+ | {{tag> statistics r "logit statistics" | ||
+ |