r:logistic_regression_analysis
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
r:logistic_regression_analysis [2016/12/14 10:13] – hkimscil | r:logistic_regression_analysis [2023/12/07 08:00] (current) – [e.g. 1] hkimscil | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | $$ log({\frac{p}{(1-p)}) = \beta_{0} + \beta_{1}X $$ | ||
- | * p = 변인 X가 A일 확률 | ||
- | * 1-p = 변인 X가 A가 아닐 확률 | ||
+ | < | ||
+ | > Logit(Turnover ~ JS, data=td) | ||
- | $$ \displaystyle{\frac{p}{(1-p)} = \beta_{0} + \beta_{1}X $$ | + | Data Frame: |
+ | Response Variable: | ||
+ | Predictor Variable 1: JS | ||
+ | |||
+ | Number of cases (rows) of data: 99 | ||
+ | Number of cases retained for analysis: | ||
+ | |||
+ | |||
+ | BASIC ANALYSIS | ||
+ | |||
+ | -- Estimated Model of Turnover for the Logit of Reference Group Membership | ||
+ | |||
+ | | ||
+ | (Intercept) | ||
+ | | ||
+ | |||
+ | |||
+ | -- Odds Ratios and Confidence Intervals | ||
+ | |||
+ | Odds Ratio Lower 95% Upper 95% | ||
+ | (Intercept) | ||
+ | | ||
+ | |||
+ | |||
+ | -- Model Fit | ||
+ | |||
+ | Null deviance: 131.746 on 97 degrees of freedom | ||
+ | Residual deviance: 126.341 on 96 degrees of freedom | ||
+ | |||
+ | AIC: 130.3413 | ||
+ | |||
+ | Number of iterations to convergence: | ||
+ | |||
+ | |||
+ | | ||
+ | Data, Fitted, Residual, Studentized Residual, Dffits, Cook's Distance | ||
+ | | ||
+ | | ||
+ | -------------------------------------------------------------------- | ||
+ | JS Turnover fitted residual rstudent | ||
+ | 69 6.00 quit 0.6838 | ||
+ | 7 1.38 stay 0.2225 | ||
+ | 73 5.48 quit 0.6327 | ||
+ | 58 5.43 quit 0.6276 | ||
+ | 12 1.72 stay 0.2493 | ||
+ | 31 1.77 stay 0.2534 | ||
+ | 13 1.96 stay 0.2695 | ||
+ | 1 4.96 quit 0.5783 | ||
+ | 33 4.88 quit 0.5698 | ||
+ | 84 4.66 quit 0.5460 | ||
+ | 63 4.65 quit 0.5449 | ||
+ | 61 2.52 stay 0.3203 | ||
+ | 97 5.59 stay 0.6438 | ||
+ | 70 5.48 stay 0.6327 | ||
+ | 74 2.56 stay 0.3242 | ||
+ | 75 2.57 stay 0.3251 | ||
+ | 67 2.65 stay 0.3329 | ||
+ | 80 5.04 stay 0.5869 | ||
+ | 77 4.46 quit 0.5243 | ||
+ | 39 4.43 quit 0.5210 | ||
+ | |||
+ | |||
+ | | ||
+ | |||
+ | Probability threshold for classification stay: 0.5 | ||
+ | |||
+ | 0: quit | ||
+ | 1: stay | ||
+ | |||
+ | Data, Fitted Values, Standard Errors | ||
+ | | ||
+ | | ||
+ | -------------------------------------------------------------------- | ||
+ | JS Turnover label fitted std.err | ||
+ | 24 0.23 | ||
+ | 88 0.67 | ||
+ | 48 1.05 | ||
+ | 66 1.19 | ||
+ | |||
+ | ... for the rows of data where fitted is close to 0.5 ... | ||
+ | |||
+ | JS Turnover label fitted std.err | ||
+ | 14 4.14 | ||
+ | 27 4.15 | ||
+ | 64 4.26 | ||
+ | 83 4.41 | ||
+ | 39 4.43 | ||
+ | |||
+ | ... for the last 4 rows of sorted data ... | ||
+ | |||
+ | JS Turnover label fitted std.err | ||
+ | 70 5.48 | ||
+ | 73 5.48 | ||
+ | 97 5.59 | ||
+ | 69 6.00 | ||
+ | -------------------------------------------------------------------- | ||
+ | |||
+ | |||
+ | ---------------------------- | ||
+ | Specified confusion matrices | ||
+ | ---------------------------- | ||
+ | |||
+ | Probability threshold for predicting stay: 0.5 | ||
+ | Corresponding cutoff threshold for JS: 4.238 | ||
+ | |||
+ | | ||
+ | --------------------------------------------------- | ||
+ | Total %Tot 0 1 %Correct | ||
+ | --------------------------------------------------- | ||
+ | | ||
+ | Turnover | ||
+ | --------------------------------------------------- | ||
+ | | ||
+ | |||
+ | Accuracy: 58.16 | ||
+ | Sensitivity: | ||
+ | Precision: 44.44 | ||
+ | |||
+ | > | ||
+ | </ | ||
+ | ====== e.g. 2 ====== | ||
< | < | ||
- | d | + | head(d) |
d$Species <- factor(d$Species) | d$Species <- factor(d$Species) | ||
str(d) | str(d) | ||
Line 209: | Line 328: | ||
{{:d3.csv}} | {{:d3.csv}} | ||
- | < | + | < |
> round(predict(m, | > round(predict(m, | ||
| |
r/logistic_regression_analysis.1481679825.txt.gz · Last modified: 2016/12/14 10:13 by hkimscil