BookmarkSubscribeRSS Feed
greveam
Quartz | Level 8

Hi,

 

I am trying to use SAS to fit an instrumental variable analysis on a binary outcome. From what I could find online, this can be done using the 2SLS estimator in proc syslin?

 

The data are as follows: death (outcome, yes/no), gene (exposure, class variable), which regulates "normalized" (mediator, continuous variable). The value of "normalized" is also affected by cohort, female, trg_i, and crp_log. What I want to know is:

 

1. If "normalized" (as an instrumental variable) is a causal risk factor for death.

2. If there is evidence for bias when using "normalized" as an observational variable vs. as an instrumental variable (using the Durbin-Wu-Hausman test) on risk of death.

 

Here is my code:

 

proc syslin data=causalmed 2sls;
endogenous normalized;
instruments gene cohort female trg_i crp_log;
model normalized = gene cohort female trg_i crp_log;
model death = normalized cohort female trg_i crp_log;
run;

 

proc model data=causalmed;
endogenous normalized;
instruments gene;
death = pnormalized*normalized + interc;
fit death / ols 2sls hausman;
quit;

 

Is my code correct? Any help would be much appreciated. Thanks!

sas-innovate-2024.png

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.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 282 views
  • 0 likes
  • 1 in conversation