Hello all,
I performed an ordered logistic regression.
ASA - categorical variable - index of how sick patients are 1-3 (3 is the sickest patient; 1 is the healthiest patient)
Anaestethictype - categorical variable 0 or 1 (0 - Local ; 1 - General anaestethic)
I then wanted to obtain the predicted probabilities of the degress of sickliness of the patient according to the anaesthethic used
So I used margins
My question:
Stata correctly for each ASA level generates probabilities for anaesthethic type 0 & 1 for each ASA level (1-3) - hoorah
However, I just want to know how does Stata know I wanted to generate these probabilities for ASA - when I have never specified them in my code?
Having following the tutorial by Statacorp
-margins- always seems to be used with other covariates
https://www.youtube.com/watch?v=7maMbX_65b0
But as my Asa is my dependent variable - its not a covariate, if I type
-margins ASA-
Stata says: factor asa not found in list of covariates
I've use the above following another tutorial, but I'm still curious how Stata knew it had to generate those probabilities for each ASA level
In addition I also tried margins with -logit-
largemandible - depedent variable - categorical variable - 0 (absent) 1 (present)
I then tried to use the -margins command-
Stata error: Factor largmandible not found in list of covariates (of course as this is the dependent variable)
I then tried
Stata error: Equation 0 not found
I performed an ordered logistic regression.
ASA - categorical variable - index of how sick patients are 1-3 (3 is the sickest patient; 1 is the healthiest patient)
Anaestethictype - categorical variable 0 or 1 (0 - Local ; 1 - General anaestethic)
Code:
ologit ASA anaestethictype age [pw=attweight], or
So I used margins
Code:
margins, at (anaesthethictype=(0/1)) predict(outcome(1)) at means //ASA1 margins, at (anaesthethictype=(0/1)) predict(outcome(1)) at means //ASA2 margins, at (anaesthethictype=(0/1)) predict(outcome(1)) at means //ASA3
My question:
Stata correctly for each ASA level generates probabilities for anaesthethic type 0 & 1 for each ASA level (1-3) - hoorah
However, I just want to know how does Stata know I wanted to generate these probabilities for ASA - when I have never specified them in my code?
Having following the tutorial by Statacorp
-margins- always seems to be used with other covariates
https://www.youtube.com/watch?v=7maMbX_65b0
But as my Asa is my dependent variable - its not a covariate, if I type
-margins ASA-
Stata says: factor asa not found in list of covariates
I've use the above following another tutorial, but I'm still curious how Stata knew it had to generate those probabilities for each ASA level
In addition I also tried margins with -logit-
largemandible - depedent variable - categorical variable - 0 (absent) 1 (present)
Code:
logit largemandible anaesthethictype age
Code:
margins largemandible
I then tried
Code:
margins, at (anaesthethictype=(0/1)) predict(outcome(0)) at means // Absent large mandible
Comment