Below is sample SAS code that was used to generate the examples in the talk. These are intended to indicate the variety of analyses possible with the OAI data with a focus on accommodating the repeated measures/clustered data nature of the dataset. They do not represent thorough data analyses. data all; set cemwork.oai_example; /* Pick out half the subjects so examples run faster*/ if id<9547618; /* Symptomatic knee OA */ sxkoa=P01SXKOA>0; /* Define definite presence of osteophytes */ defosteo=(svgkost=2); run; /* For repeated measures analyses, data should be sorted by id */ proc sort; by id visit; run; /* Extract baseline data only for first three analyses */ data bl; set work.all; if visit=0; run; title "Cross-sectional analysis of KOOS QoL"; /* Example 1: Association of KOOS QoL as a function of baseline BMI */ proc glm data=work.bl; model koosqol=bmi; run; title "Clustered baseline of WOMAC pain score"; /* Example 2: Comparing association of WOMAC pain score with symptomatic knee OA between men and women at baseline only */ /* Using GEE methods assuming independence working correlation */ proc genmod data=work.bl; class p02sex id; model womkpg=SXKOA p02sex SXKOA*p02sex; repeated subject=id; run; /* Example 2: GEE specifying an exchangeable working correlation structure */ proc genmod data=work.bl; class p02sex id; model womkpg=sxkoa p02sex sxkoa*p02sex; repeated subject=id / type=exch; run; /* Example 2: using mixed model */ proc mixed data=work.bl noclprint; class p02sex id; model womkpg=sxkoa p02sex sxkoa*p02sex/solution; random intercept/ subject=id; run; /* Example 2: using mixed model with EMPIRICAL option */ proc mixed data=work.bl empirical noclprint; class p02sex id; model womkpg=sxkoa p02sex sxkoa*p02sex/solution; random intercept/subject=id; run; title "Binary outcome clustered"; /* Example 3: Does pain scale predict presence of osteophytes at baseline */ proc genmod data=work.bl descending; class id; model defosteo=P7GKRCV / dist=bin; estimate "pain effect" p7gkrcv 1 / exp; repeated subject=id / type=exch; run; title "Longitudinal"; /* Example 4: Does change in WOMAC pain depend on baseline SX KOA?*/ /* Using GEEs */ proc genmod data=work.all; class p02sex id visit; model womkpg=sxkoa p02sex visit sxkoa*p02sex sxkoa*visit; repeated subject=id; run; /* Example 4: GEE specifying an exchangeable working correlation structure */ proc genmod data=work.all; class p02sex id visit; model womkpg=sxkoa p02sex visit sxkoa*p02sex sxkoa*visit; repeated subject=id/type=exch; run; /* Example 4: mixed model specifying an exchangeable working correlation structure */ proc mixed data=work.all noclprint; class p02sex id visit; model womkpg=sxkoa p02sex visit sxkoa*p02sex sxkoa*visit/solution; random id; run; /* Example 4: mixed model using EMPIRICAL option */ proc mixed data=work.all noclprint empirical; class p02sex id visit; model womkpg=sxkoa p02sex visit sxkoa*p02sex sxkoa*visit/solution; random intercept/subject=id; run; /* Example 4: mixed model specifying a nested error structure */ proc mixed data=work.all noclprint; class p02sex id visit; model womkpg=sxkoa p02sex visit sxkoa*p02sex sxkoa*visit/solution; random id visit(id); run;