Hi all,
I have a dataset with a binary outcome (The prescription of drug A Yes/No). My dataset is at patient level, meaning there are unique patients in the dataset. We wanted to consider how neighborhoods could affect the use of drug A, so we merged our data by census tracts to neighborhood-level factors (proportion in the census tract living below the poverty level, proportion with a high school degree). The dataset is now set up such that patients in the same census tracts have the same neighborhood level values (see dataset below). I want to run a logistic regression to predict the use of drug A, but I would like to account for the repeated values as a result of the census tract. How do I do this?
PatientID | age | sex | diabetes | arthritis | Drug A | census_tract | prop_below_poverty | prop_with_highschool |
1 | 47 | male | 0 | 1 | 1 | 47157002000 | 15.0 | 47.0 |
2 | 51 | female | 0 | 0 | 1 | 47157002000 | 15.0 | 47.0 |
3 | 34 | female | 1 | 1 | 0 | 47157002000 | 15.0 | 47.0 |
4 | 65 | male | 1 | 0 | 0 | 47157008500 | 8.6 | 75.0 |
5 | 27 | male | 1 | 0 | 1 | 47157008500 | 8.6 | 75.0 |
6 | 34 | male | 0 | 0 | 0 | 47157008500 | 8.6 | 75.0 |
7 | 70 | female | 1 | 1 | 1 | 47157008500 | 8.6 | 75.0 |
8 | 62 | male | 1 | 0 | 1 | 47157021136 | 12.1 | 62.0 |
Drug A = dependent variable /outcome. (Was determined at patient level)
Diabetes ( 0 = no diabetes, 1 = has diabetes)
arthritis (0 = no arthritis, 1 has arthritis)
prop_below_poverty and prop_with_highschool (continuous variables calculated as percentages)
Thank you.
You can use the REPEATED statement in PROC GEE to fit the logistic model accounting for the correlation within neighborhood clusters. For example,
proc gee;
class census_tract sex;
model drug_a(event="1") = age sex arthritis prop_below_poverty prob_with_highschool / dist=bin;
repeated subject=census_tract / type=exch;
run;
proc logistic data = A descending;
Class diabetes (ref = '0')/ param = ref;
Class arthritis (ref = '0')/ param = ref;
class sex (ref = '0')/ param = ref;
model DrugA (EVENT = '1') = age sex diabetes arthritis prop_below_poverty prop_with_highschool;
run;
The above SAS codes show the simple logistic regression I did without accounting for the repeated values of "prop_below_poverty" and "prop_with_highschool"
You can use the REPEATED statement in PROC GEE to fit the logistic model accounting for the correlation within neighborhood clusters. For example,
proc gee;
class census_tract sex;
model drug_a(event="1") = age sex arthritis prop_below_poverty prob_with_highschool / dist=bin;
repeated subject=census_tract / type=exch;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.