BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
derbygun
Fluorite | Level 6

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? 

 

PatientIDage sexdiabetesarthritisDrug Acensus_tractprop_below_povertyprop_with_highschool
147male0114715700200015.047.0
251female0014715700200015.047.0
334female1104715700200015.047.0
465male100471570085008.675.0
527male101471570085008.675.0
634male000471570085008.675.0
770female111471570085008.675.0
862male1014715702113612.162.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. 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

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;

View solution in original post

2 REPLIES 2
derbygun
Fluorite | Level 6
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"

StatDave
SAS Super FREQ

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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 663 views
  • 1 like
  • 2 in conversation