Hi all,
Long-time user, first-time poster.
I am using Stata 17/SE on Mac and I am running into an r(322) error when I run margins post-Logistic regression. I've run similar code before and have not had any issues previously, so I am really unsure what is causing it.
For context, I am working with tennis data. Where 'tb' refers to a tiebreak and 'ppw' refers to the percentage of points won. Most variables are dummies, aside from a few that indicate score/number of points won/etc.
My code is as follows:
Where set1ppw_tX is a generated int (of total percentage of points won):
This is an example of my data:
The error comes when I try to run:
Am I making an obvious error here? Have I been sitting in front of Stata too long? I've run similar code before and not had any issues
Any help is appreciated!
...Also I know these variables are horribly named, haha!
Long-time user, first-time poster.
I am using Stata 17/SE on Mac and I am running into an r(322) error when I run margins post-Logistic regression. I've run similar code before and have not had any issues previously, so I am really unsure what is causing it.
For context, I am working with tennis data. Where 'tb' refers to a tiebreak and 'ppw' refers to the percentage of points won. Most variables are dummies, aside from a few that indicate score/number of points won/etc.
My code is as follows:
Code:
logistic set2win_t i.set1ppw_tX set1_tb_t if team_unique == 1 & set1tb_dum == 1 & set2tb_dum == 0 & gender == 0, cluster(match_id) test i45.set1ppw_tX == i55.set1ppw_tX levels set1ppw_tX, local(lvs) margins, at(set1tb_ppw_t=(`lvs'))
Code:
gen int set1ppw_tX = round(set1tb_ppw_t, 0.05)*100
Code:
+-------------------------------------------------------------------------------------+
| match_id team_u~e gender set1tb~m set2tb~m set2wi~t set1pp~X set1_t~t |
|-------------------------------------------------------------------------------------|
12817. | 3205 1 0 1 0 0 55 8 |
12818. | 3205 . 0 1 0 0 55 8 |
12819. | 3205 1 0 1 0 1 45 6 |
12820. | 3205 . 0 1 0 1 45 6 |
|-------------------------------------------------------------------------------------|
14385. | 3597 1 1 1 0 0 30 3 |
14386. | 3597 . 1 1 0 0 30 3 |
14387. | 3597 1 1 1 0 1 70 7 |
14388. | 3597 . 1 1 0 1 70 7 |
|-------------------------------------------------------------------------------------|
14449. | 3613 1 1 1 0 0 35 4 |
14450. | 3613 . 1 1 0 0 35 4 |
14451. | 3613 1 1 1 0 1 65 7 |
14452. | 3613 . 1 1 0 1 65 7 |
|-------------------------------------------------------------------------------------|
Code:
margins, at(set1tb_ppw_t=(`lvs'))
Any help is appreciated!
...Also I know these variables are horribly named, haha!

Comment