Date: Mon, 22 Dec 2008 10:07:38 -0500
Reply-To: "Simon, Lorna" <Lorna.Simon@UMASSMED.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Simon, Lorna" <Lorna.Simon@UMASSMED.EDU>
Subject: Help with proc mixed
Content-Type: text/plain; charset=us-ascii
I am trying to use the mixed procedure to model total costs, where total
cost is collected at each one-month follow-up. The greatest number of
follow-ups is 24; 75% of the sample has at least 12 months of follow-up.
My data look like this:
Print of concatenated dataset
09:51 Monday, December 22, 2008 1
No_health_ substance_
scattered_ time_
Obs clientid fu totalcost male insurance abuse
white housing homeless age
1 1010 0 2026 1 0 0
1 . 60 51
2 1010 1 0 1 0 0
1 . 60 51
3 1010 1 0 1 0 0
1 . 60 51
4 1010 1 0 1 0 0
1 . 60 51
5 1010 1 0 1 0 0
1 . 60 51
6 1010 1 0 1 0 0
1 . 60 51
7 1010 1 0 1 0 0
1 . 60 51
8 1010 1 0 1 0 0
1 . 60 51
9 1010 1 0 1 0 0
1 . 60 51
10 1010 1 0 1 0 0
1 . 60 51
11 1010 1 0 1 0 0
1 . 60 51
12 1010 1 0 1 0 0
1 . 60 51
13 1010 1 0 1 0 0
1 . 60 51
14 1010 1 0 1 0 0
1 . 60 51
15 1010 1 0 1 0 0
1 . 60 51
16 1010 1 0 1 0 0
1 . 60 51
17 1010 1 0 1 0 0
1 . 60 51
18 1010 1 0 1 0 0
1 . 60 51
19 1010 1 0 1 0 0
1 . 60 51
20 1010 1 0 1 0 0
1 . 60 51
21 1010 1 0 1 0 0
1 . 60 51
22 1010 1 0 1 0 0
1 . 60 51
23 1010 1 0 1 0 0
1 . 60 51
24 1013 0 0 1 0 0
0 0 36 .
25 1013 1 0 1 0 0
0 0 36 .
26 1013 1 . 1 0 0
0 0 36 .
27 1013 1 0 1 0 0
0 0 36 .
28 1013 1 0 1 0 0
0 0 36 .
29 1013 1 0 1 0 0
0 0 36 .
30 1013 1 0 1 0 0
0 0 36 .
31 1013 1 0 1 0 0
0 0 36 .
32 1013 1 0 1 0 0
0 0 36 .
33 1013 1 0 1 0 0
0 0 36 .
34 1013 1 0 1 0 0
0 0 36 .
35 1013 1 0 1 0 0
0 0 36 .
36 1013 1 0 1 0 0
0 0 36 .
The variable fu denotes a follow-up visit, where 1=follow-up, 0=initial
visit.
When I run the proc mixed it looks like it's only using the initial
visits, as it only reads in 159 observations.
Here is my output from proc mixed:
Class Level Information
Class Levels Values
clientid 159 1017 1018 1021 1036 1039 1045
1065 1070 1073 1076 1077 1079
1080 1085 1093 1094 1095 1096
1099 1106 1107 1108 1109 1110
1111 1112 1114 1115 1116 1117
1118 1119 1120 1121 1123 1124
1125 2004 2006 2012 2013 2014
2015 2017 2018 2019 2023 2224
3001 3006 3007 3008 3011 3012
3014 3015 3016 3151 3152 3154
3156 3157 3301 3302 3305 3307
3309 3310 3311 3312 3313 4001
4003 4004 4027 5001 5003 5004
5005 5006 5010 5011 5012 5301
5303 5304 5306 5308 5309 5310
5311 5314 5315 5602 5604 5605
5607 5611 5612 6007 6012 6013
6014 6015 6017 716251-s
71834-G 7216838-B 7223713-V
746734-G 8001 8002 8003 8004
8005 8008 8010 8011 8013 8014
8015 8016 8017 8018 8019 9002
9013 9014 9015 9016 9017 9020
9021 9023 9024 9026 9028 9029
9030 B001 B002 B003 B004 B005
B006 B007 B008 B009 B010 B012
B013 B014 B016 B017 BH00 BH03
Z002 Z005 Z017
09:51 Monday, December 22, 2008 54
The Mixed Procedure
Dimensions
Covariance Parameters 1
Columns in X 9
Columns in Z 0
Subjects 159
Max Obs Per Subject 1
Number of Observations
Number of Observations Read 1826
Number of Observations Used 159
Number of Observations Not Used 1667
Iteration History
Iteration Evaluations -2 Res Log Like Criterion
0 1 3502.37548392
1 1 3502.37548392 0.00000000
Convergence criteria met.
Estimated R
Matrix for
clientid 1017
Row Col1
1 5.9692E8
09:51 Monday, December 22, 2008 55
The Mixed Procedure
Covariance Parameter Estimates
Cov Parm Subject Estimate
UN(1,1) clientid 5.9692E8
Fit Statistics
-2 Res Log Likelihood 3502.4
AIC (smaller is better) 3504.4
AICC (smaller is better) 3504.4
BIC (smaller is better) 3507.4
Null Model Likelihood Ratio Test
DF Chi-Square Pr > ChiSq
0 0.00 1.0000
Solution for Fixed Effects
Standard
Effect Estimate Error DF t Value Pr >
|t|
Intercept 20087 10923 150 1.84
0.0679
male -6492.44 4914.47 150 -1.32
0.1885
No_health_insurance -12402 11161 150 -1.11
0.2683
substance_abuse 4894.27 4539.70 150 1.08
0.2827
white 1528.88 4936.32 150 0.31
0.7572
ethnicity 1183.47 8998.36 150 0.13
0.8955
scattered_housing 5924.68 4005.03 150 1.48
0.1412
time_homeless 86.0865 25.7034 150 3.35
0.0010
age -195.33 195.19 150 -1.00
0.3186
Here is my syntax for the mixed procedure:
proc mixed;
class clientid;
model totalcost=male no_health_insurance substance_abuse white ethnicity
scattered_housing time_homeless age/s;
repeated/type=un subject=clientid r;
title;
run;
Any help would be appreciated. I followed the example from sas help, so
I don't know why it isn't using all the observations.