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 [2023/12/04 15:49] – hkimscil | r:logistic_regression_analysis [2023/12/07 08:00] (current) – [e.g. 1] hkimscil | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | \begin{align} | ||
- | \displaystyle log \left( {\frac{p}{(1-p)}} \right) = \beta_{0} + \beta_{1}X | ||
- | \end{align} | ||
- | * p = 변인 X가 A일 확률 | + | < |
- | * 1-p = 변인 X가 A가 아닐 확률 | + | > Logit(Turnover ~ JS, data=td) |
- | * $log \left( {\frac{p}{(1-p)}} \right) $ 을 $\text{logit(p)}$ 로 부른다 | + | |
- | \begin{align*} | + | Data Frame: |
- | \text{logit(p)} & = log \left( {\frac{p}{(1-p)}} \right) = \beta_{0} + \beta_{1}X | + | |
- | \frac{1-p}{p} & = \frac {1} {exp(\beta_{0} + \beta_{1}X)} \\ | + | |
- | \frac{1}{p} | + | |
- | \frac{1}{p} | + | |
- | p & = \frac {exp(\beta_{0} + \beta_{1}X)} {1 + exp(\beta_{0} + \beta_{1}X)}\\ | + | |
- | \end{align*} | + | |
+ | 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 ====== | ||
< | < | ||
head(d) | head(d) |
r/logistic_regression_analysis.1701672589.txt.gz · Last modified: 2023/12/04 15:49 by hkimscil