Good afternoon,
When I run my logistic regression, everything comes out OK with no strange data. However, when I run the estat command, all my data is in the positive category. I'm very new to STATA and our class encourages us to copy paste from the tutor's .do file an instert our own varibales. I've tried researching, but I'm unsure if this is the output I'm supposed to get, or if there's an error in my code, as my Tutor's print out populates all four categories. Im using the following code for the dummy variables:
*Q14 Social Media usage*
gen SMuse =1 if Q14 == 4 | Q14== 5 | Q14 == 2 | Q14 == 3
replace SMuse = 0 if Q14 == 1
label define SMuse 1 "Use" 0 "Don't use"
label values SMuse SMuse
*Q22a Transfer Powers to or from the EU*
gen NationalPower = 1 if Q22a == 2
replace NationalPower = 0 if Q22a == 1 | Q22a == 97
label define NationalPower 1 "Agree" 0 "Disagree"
label values NationalPower NationalPower
*Q23a EU Membership is Good or Bad*
gen MembershipEU = 1 if Q23a == 2
replace MembershipEU = 0 if Q23a == 1 | Q23a == 97
label define MembershipEU 1 "Agree" 0 "Disagree"
label values MembershipEU MembershipEU
*Q28a Immigrants should adopt UK Values*
gen UKValues = 1 if Q28a == 1
replace UKValues = 0 if Q28a == 2 | Q28a == 97
label define UKValues 1 "Agree" 0 "Disagree"
label values UKValues UKValues
*Q30a Immigrants are good for the UK Economy*
gen ImmigrationEco = 1 if Q30a == 2
replace ImmigrationEco = 0 if Q30a == 1 | Q30a == 97
label define ImmigrationEco 1 "Agree" 0 "Disagree"
label values ImmigrationEco ImmigrationEco
logit NationalPower SMuse UKValues MembershipEU ImmigrationEco
logit NationalPower SMuse UKValues MembershipEU ImmigrationEco, or
estat classification
lroc
*** Generate predicted probabilities
predict p
*** Predict standardized residuals
predict stdres, rstand
*** Scatterplot of standardized residuals and predicted probabilities
scatter stdres p, mlabel(NationalPower) yline(0)
end
The roc test shows only 16 cases despite it being recording 1771 as the number of observations. Additionally, my Agree/Dissagree variables overlap on the scatterplot. Below are the print outs:
Array Array
Array
Additionally when I start running diagnostics on the model, all my cases seem to overlap. If you require more information, I'll send it through ASAP.
Thank you for your time. - Tom
Related Posts with 100% sensitivity in my estat test, no data classified as negative & I'm only seeing 16/1771 case on my roc print out and scatterplot
Non-linear graphs comparisonGood morning or evening, dear community, I have a struggle with how to better approach a comparison …
Setting e(sample) to compute boostrap standard errorsHello, I am trying to obtain direct and indirect effects for multiple mediators with multiply imput…
How to plot regression in an intervalHi all, can any of you tell me if the below representation of regression analysis is possible in ST…
multiple fixed effect wiith areghi. a run this code, but i faced with an error. please help me. xi: areg inv RE_value index_state yr…
Interpreting coefficient vs. margins from three-way interactionHello, I have a question regarding the interpretation of a three-way interaction in a GEE model wit…
Subscribe to:
Post Comments (Atom)
0 Response to 100% sensitivity in my estat test, no data classified as negative & I'm only seeing 16/1771 case on my roc print out and scatterplot
Post a Comment