Software: IVEware: Imputation and Variance Estimation Software: IVEware Version 0.3 Documentation: IVEware User Guide

Chapter 11: SRCware

11.1 Introduction

Chapter 11 demonstrates use of SRCWare, the stand-alone version of IVEware. This chapter includes examples of the IMPUTE, BBDESIGN, DESCRIBE, REGRESS, SYNTHESIZE, and COMBINE commands. Input data sets are read into SRCWare using the GETDATA command while data sets from SRCWare can be output using the PUTDATA command. Output data sets can be used in subsequent analyses using a software of choice. For examples of the GETDATA and PUTDATA commands, see Section 1.6 and provided examples on the IVEware website. Because the IVEware commands have been detailed in previous chapters, just the code is presented in this chapter.

Back to top

11.2 IMPUTE Example

<srcware name="SRCWARE_IMPUTE">

/* import the input datasets */
<getdata name="ncsr_ex1">
table ncsr_ex1.txt;
run;
</getdata>

/* Multiple Imputation using IMPUTE*/
<impute name="MI">
title Multiple Imputation Using IMPUTE ;
datain ncsr_ex1 ;
dataout impute_mult1;
default categorical;
continuous bmi intwage ncsrwtsh sestrat ;
transfer caseid ;
iterations 5;
multiples 5;
seed 2001;
run;
</impute>

/* Extract remaining data sets */
<putdata name="MI" mult="2" dataout="impute_mult2" />
<putdata name="MI" mult="3" dataout="impute_mult3" />
<putdata name="MI" mult="4" dataout="impute_mult4" />>
<putdata name="MI" mult="5" dataout="impute_mult5" />

</srcware>

Back to top

11.3 BBDESIGN Example

<srcware name="SRCWARE_BBDESIGN">

/* import the input dataset*/
<getdata name="nhanes1112_adult">
table nhanes1112_adult.txt;
run;
</getdata>

<bbdesign name="BBdesign">
title Use of BBdesign;
datain nhanes1112_adult;
dataout bbdesign_samples ;
stratum sdmvstra ;
cluster sdmvpsu ;
weight wtmec2yr ;
csamples 5 ;
wsamples 5 ;
seed 2001;
run;
</bbdesign>

</srcware>

Back to top

11.4 DESCRIBE Example

<srcware name="SRCWARE_IMPUTE">

/* import the input dataset */
<getdata name="ncsr_ex1">
table ncsr_ex1.txt;
run;
</getdata>

/* Review of Multiple Imputation using IMPUTE*/
<impute name="MI">
title Multiple Imputation Using IMPUTE ;
datain ncsr_ex1 ;
dataout impute_mult1;
default categorical;
continuous bmi intwage ncsrwtsh sestrat ;
transfer caseid ;
iterations 5;
multiples 5;
seed 2001;
run;
</impute>

/* Extract remaining data sets */

<putdata name="MI" mult="2" dataout="impute_mult2" />
<putdata name="MI" mult="3" dataout="impute_mult3" />
<putdata name="MI" mult="4" dataout="impute_mult4" />
<putdata name="MI" mult="5" dataout="impute_mult5" />

/* Descriptive Analysis of Age at Interview and BMI, Missing Data Imputed by IVEware */
<describe name="DESCRIBE">
title MI Design-based Description;
datain impute_mult1 impute_mult2 impute_mult3 impute_mult4 impute_mult5 ;
stratum sestrat;
cluster seclustr;
weight ncsrwtsh ;
model mult;
mean intwage bmi;
contrast sexf;
run;
</describe>
</scrware>

Back to top

11.5 REGRESS Example

<srcware name="SRCWARE_IMPUTE">

/* import the input datasets */
<getdata name="ncsr_ex1">
table ncsr_ex1.txt;
run;
</getdata>

/* Review of Multiple Imputation using IMPUTE*/
<impute name="MI">
title Multiple Imputation Using IMPUTE ;
datain ncsr_ex1 ;
dataout impute_mult1;
default categorical;
continuous bmi intwage ncsrwtsh sestrat ;
transfer caseid ;
iterations 5;
multiples 5;
seed 2001;
run;
</impute>

/* Extract remaining data sets */

<putdata name="MI" mult="2" dataout="impute_mult2" />
<putdata name="MI" mult="3" dataout="impute_mult3" />
<putdata name="MI" mult="4" dataout="impute_mult4" />
<putdata name="MI" mult="5" dataout="impute_mult5" />

/* Analyze Previously Imputed Data Sets using Linear Regression with REGRESS */
/* Example uses Complex Sample Design Variables and Weight Plus Plots */

<regress name="REGRESS">
title Linear Regression using REGRESS with Imputed Data Sets;
datain impute_mult1 impute_mult2 impute_mult3 impute_mult4 impute_mult5 ;
estout impute_regress;
stratum sestrat;
cluster seclustr;
weight ncsrwtsh;
dependent bmi;
predictor mde sexf intwage ;
link linear ;
plots outplots ;
run;
</regress>
</srcware>

Back to top

11.6 SYNTHSIZE Example

<srcware name="SRCWARE_SYNTHESIZE">
/* import the input datasets */
<getdata name="test">
table test.txt;
run;
</getdata>

/* Use SYNTHESIZE command to prepare fully synthesized data set*/
<synthesize name="Synthesize">
datain test;
continuous AGE NUMCIG YRSSMOKE FATINDEX DHA_EPA REDTOT WGTKG TOTLKCAL HGTCM ;
categorical CASECNT GENDER RACE3 HYPER DIAB SMOKE FAMMI EDUSUBJ3 CHOLESTH ;
mixed CAFFTOT ALCOHOL3 ;
transfer STUDYID ;
synthesize CASECNT AGE GENDER RACE3 HYPER DIAB SMOKE NUMCIG
YRSSMOKE FATINDEX FAMMI EDUSUBJ3 DHA_EPA REDTOT CHOLESTH CAFFTOT WGTKG TOTLKCAL
ALCOHOL3 HGTCM ;
restrict NUMCIG(smoke=2,3) YRSSMOKE(smoke=2,3) ;
bounds NUMCIG(>0) YRSSMOKE(>0, <age-12) DHA_EPA(>0) REDTOT(>0) CAFFTOT(>0) TOTLKCAL(>0) ALCOHOL3(>0);
ITERATIONS 2;
MULTIPLES 5;
SEED 2001;
IMPLICATES 5;
DATAOUT synthesize all ;
run;
</synthesize>
</srcware>

Back to top

11.7 COMBINE Example

<srcware name="SRCWARE_COMBINE">

/* import the input datasets */
<getdata name="hrs2006_27jul2016">
table hrs2006_27jul2016.csv;
run;
</getdata>

<getdata name="hrs2008_27jul2016">
table hrs2008_27jul2016.csv;
run;
</getdata>

<getdata name="hrs2010_27jul2016">
table hrs2010_27jul2016.csv;
run;
</getdata>

<getdata name="hrs2012_27jul2016">
table hrs2012_27jul2016.csv;
run;
</getdata>

/* COMBINE Example Using HRS 2006 2008 2010 and 2012 Data*/
<combine name="COMBINE">
datain hrs2006_27jul2016 hrs2008_27jul2016 hrs2010_27jul2016 hrs2012_27jul2016 ;
dataout combined_hrs_2006_2012 all ;
run;
</combine>
</srcware>

Back to top