1 The SAS System 21:40 Tuesday, January 30, 2007
NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) 9.1 (TS1M2)
Licensed to UNIVERSITY OF CALIFORNIA SYSTEM-T/R, Site 0029107001.
NOTE: This session is executing on the SunOS 5.9 platform.
You are running SAS 9. Some SAS 8 files will be automatically converted
by the V9 engine; others are incompatible. Please see
http://support.sas.com/rnd/migration/planning/platform/64bit.html
PROC MIGRATE will preserve current SAS file attributes and is
recommended for converting all your SAS libraries from any
SAS 8 release to SAS 9. For details and examples, please see
http://support.sas.com/rnd/migration/index.html
This message is contained in the SAS news file, and is presented upon
initialization. Edit the file "news" in the "misc/base" directory to
display site-specific news and information in the program log.
The command line option "-nonews" will prevent this display.
NOTE: SAS initialization used:
real time 0.16 seconds
cpu time 0.12 seconds
1 * MMA27P2MILOGIT.SAS January 2007 for SAS version 8.2
2 * based on milogit.sas
3
4 ********** OVERVIEW OF MMA27P4MILOGIT.SAS **********
5
6 * SAS Program
7 * copyright C 2005 by A. Colin Cameron and Pravin K. Trivedi
8 * used for "Microeconometrics: Methods and Applications"
9 * by A. Colin Cameron and Pravin K. Trivedi (2005)
10 * Cambridge University Press
11
12 * Chapter 27.8.2 p.937-939
13
14 * This program creates the fifth column of Table 27.5
15 * This is for case
16 * 1: 10% missing rho=0.64 for Table 27.5 and mma27logit1.asc
17 * using data created using MMA27P3LOGIT.DO
18 * and for 1,000 Markov Chain repetitions after burn in.
19
20 * THE OUTPUT DIFFERS FROM THAT GIVEN IN THE BOOK
21 * BECAUSE A DIFFERENT SEED WSA USED LEADING TO DIFFERENT DATA SET.
22
23 * For different number of repititions change niter below
24 * For different tables change the data set
25
26 ***********************************************************;
27 ***** MULTIPLE IMPUTATION BY SAS PROC MI **************;
28 ***********************************************************;
29
2 The SAS System 21:40 Tuesday, January 30, 2007
30 /* set parameters */
31
32 %let missingdata = mma27logit1.asc;
33 /* The name of the dataset produced by Stata */
34 /* For case 2, use mma27logit2.asc, etc. */
35 %let newdata = mma27logit1;
36 /* The name of the SAS dataset to be created */
37 /* For case 2, use mma27logit2, etc.*/
38 %let ana=ana1;
39 /* The intermediate dataset for MI analysis */
40 /* For case 2, use ana2, etc.*/
41
42 %let niter = 1000; /* Length of MCMC - values used were 10, 1000, 5000 and 10000 */
43 %let nimpute = 10; /* Number of imputaions, set to be 10 here */
44 %let nbiter = 500; /* Number of burn-in replications, set to 500 here */
45
46 /* Load the data */
47
48 data &newdata;
49 infile "&missingdata";
50 input y x1missing x2missing;
51 run;
NOTE: The infile "mma27logit1.asc" is:
File Name=/p/home/cameron/mma27logit1.asc,
Owner Name=cameron,Group Name=staff,
Access Permission=rw-r--r--,
File Size (bytes)=32000
NOTE: 1000 records were read from the infile "mma27logit1.asc".
The minimum record length was 31.
The maximum record length was 31.
NOTE: The data set WORK.MMA27LOGIT1 has 1000 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.09 seconds
cpu time 0.03 seconds
52
53 /* Multiple imputation */
54
55 proc mi data=&newdata out=&ana seed=1401 nimpute=&nimpute;
56 var y x1missing x2missing;
57 MCMC nbiter=&nbiter niter=&niter;
58 run;
NOTE: The EM algorithm (MLE) converges in 7 iterations.
NOTE: The EM algorithm (posterior mode) converges in 3 iterations.
NOTE: The data set WORK.ANA1 has 10000 observations and 4 variables.
NOTE: The PROCEDURE MI printed pages 1-2.
NOTE: PROCEDURE MI used (Total process time):
real time 10.94 seconds
cpu time 9.88 seconds
59
60 /* Logit analysis for each imputation */
61
3 The SAS System 21:40 Tuesday, January 30, 2007
62 proc logistic data=&ana outest=estimate covout;
63 model y(event='1')=x1missing x2missing;
64 by _imputation_;
65 run;
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=1
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=2
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=3
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=4
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=5
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=6
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=7
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=8
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=9
NOTE: PROC LOGISTIC is modeling the probability that y=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=10
NOTE: There were 10000 observations read from the data set WORK.ANA1.
NOTE: The data set WORK.ESTIMATE has 40 observations and 9 variables.
NOTE: The PROCEDURE LOGISTIC printed pages 3-22.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.47 seconds
cpu time 0.26 seconds
66
67 /* Combine individual analysis to one final result*/
68
69 proc mianalyze data=estimate;
70 var intercept x1missing x2missing;
4 The SAS System 21:40 Tuesday, January 30, 2007
71 run;
WARNING: The VAR statement of earlier releases has been replaced by the MODELEFFECTS statement. The VAR statement will not be
supported in future releases.
NOTE: The PROCEDURE MIANALYZE printed page 23.
NOTE: PROCEDURE MIANALYZE used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
72
73
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 11.71 seconds
cpu time 10.33 seconds