01-20-2025
edhuang
Obsidian | Level 7
Member since
05-02-2020
- 25 Posts
- 5 Likes Given
- 1 Solutions
- 1 Likes Received
-
Latest posts by edhuang
Subject Views Posted 2026 06-02-2021 08:19 PM 2052 06-02-2021 11:30 AM 2073 06-02-2021 10:36 AM 2103 06-02-2021 02:18 AM 2105 06-02-2021 01:43 AM 2243 05-31-2021 12:39 AM 1827 05-19-2021 01:30 AM 1829 05-19-2021 01:28 AM 1902 05-17-2021 09:37 PM 1973 05-17-2021 12:36 AM -
Activity Feed for edhuang
- Posted Re: Proc Glimmix Covariance Parameter Estimates on Statistical Procedures. 06-02-2021 08:19 PM
- Posted Re: Proc Glimmix Covariance Parameter Estimates on Statistical Procedures. 06-02-2021 11:30 AM
- Posted Re: Proc Glimmix Covariance Parameter Estimates on Statistical Procedures. 06-02-2021 10:36 AM
- Posted Re: Proc Glimmix Covariance Parameter Estimates on Statistical Procedures. 06-02-2021 02:18 AM
- Posted Re: Proc Glimmix Covariance Parameter Estimates on Statistical Procedures. 06-02-2021 01:43 AM
- Posted Proc Glimmix Covariance Parameter Estimates on Statistical Procedures. 05-31-2021 12:39 AM
- Posted Re: Proc Glimmix Estimate output on Statistical Procedures. 05-19-2021 01:30 AM
- Posted Re: Proc Glimmix Estimate output on Statistical Procedures. 05-19-2021 01:28 AM
- Posted Re: Proc Glimmix Estimate output on Statistical Procedures. 05-17-2021 09:37 PM
- Posted Proc Glimmix Estimate output on Statistical Procedures. 05-17-2021 12:36 AM
- Posted Re: Percentage as outcome on Statistical Procedures. 12-19-2020 12:52 AM
- Posted Percentage as outcome on Statistical Procedures. 12-14-2020 02:26 AM
- Posted Re: Select when statements on SAS Programming. 12-07-2020 09:53 AM
- Posted Select when statements on SAS Programming. 12-07-2020 01:00 AM
- Got a Like for Re: Looping through dataset library with macro function. 09-09-2020 12:52 AM
- Posted Re: Looping through dataset library with macro function on SAS Programming. 09-09-2020 12:41 AM
- Liked Re: Looping through dataset library with macro function for ChrisNZ. 09-09-2020 12:41 AM
- Liked Re: Looping through dataset library with macro function for hhinohar. 09-09-2020 12:41 AM
- Posted Re: Looping through dataset library with macro function on SAS Programming. 09-08-2020 04:25 PM
- Posted Re: Looping through dataset library with macro function on SAS Programming. 09-08-2020 12:12 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 2 1 1 -
My Liked Posts
Subject Likes Posted 1 09-09-2020 12:41 AM
06-02-2021
08:19 PM
Hi Steve,
I just changed my correlation matrix type to VC and it appears to converge. Ar(1) may be too complex.
I tried your method, but it appears that I need three parameters and not just 2. In my original case, I estimated only the G-side. It may be that I need more when I am estimating both the g-side and also r-side using my newer model.
... View more
06-02-2021
11:30 AM
Hi Steve,
Excuse my ignorance. But exactly, what parameter values do I take from the results of the Laplace model for my PARMS statement in the RSPL model?
... View more
06-02-2021
10:36 AM
Hi Steve,
Thanks. So I tried using your method=rspl (linearization method) as oppose to integral method. At first, I thought it may be that my model was too complex, so I took out all of my covariates, but the same thing occurred. Any pointers on how to troubleshoot this? I will add @jiltao as well for suggestions.
NOTE: The GLIMMIX procedure is modeling the probability that adeno_yes='1'. WARNING: Obtaining minimum variance quadratic unbiased estimates as starting values for the covariance parameters failed. NOTE: PROCEDURE GLIMMIX used (Total process time): real time 9.62 seconds cpu time 9.51 seconds
... View more
06-02-2021
02:18 AM
Hi jiltao,
Your comment is interesting to me.
So I would like to model the clustering effect of physicians (labeled as nMD) on patient outcome (adeno_yes), but also account for the correlation they have over time (procyear).
Are you suggesting my RANDOM statements should be as follows instead?
One random statement for the random effects (random int/sub=nMD) and another for the repeated measure (random procyear/sub=nMD type=ar(1) residual)
proc glimmix data=newadr_ge200_avg_2012_v2;
class nMD procyear nMDsex nMDloc_new age_newcat2 nsex nrace1_newcat2 charlson_newcat2 bmi_newcat2 nsmoke3
nprepquality2 endocuff_newcat mean_vol_cat expyear_cat/ref=first;
model adeno_yes(event=last)=procyear age_newcat2 nsex nrace1_newcat2 charlson_newcat2 bmi_newcat2 nsmoke3
nMDsex nMDloc_new nprepquality2 endocuff_newcat mean_vol_cat expyear_cat/cl dist=binary link=logit solution;
random int/sub=nMD;
random procyear/sub=nMD type=ar(1) residual;
run;
... View more
06-02-2021
01:43 AM
Hi Steve, Thanks. That's helpful.
... View more
05-31-2021
12:39 AM
Hi,
I'm wondering if someone can help me understand how to interpret the covariance parameter with my following code. What does estimate for variance and AR(1) mean and how are they related? My response (adeno_yes) is binary, so I'm having a harder time grasping this.
proc glimmix data=newadr_ge200_avg_2012_v2 noclprint method=laplace;
class nMD procyear nMDsex nMDloc age_newcat2 nsex nrace1_newcat2 charlson_newcat2 bmi_newcat2 nsmoke3
nprepquality2 endocuff_newcat mean_vol_cat expyear_cat/ref=first;
model adeno_yes(event=last)=procyear
age_newcat2 nsex nrace1_newcat2 charlson_newcat2 bmi_newcat2 nsmoke3 /*patient related characteristics*/
nMDsex nMDloc nprepquality2 endocuff_newcat mean_vol_cat expyear_cat/cl dist=binary link=logit solution oddsratio;
random procyear/sub=nMD type=ar(1) s CL;
covtest/wald;
run;
My covariance parameter output is below.
Covariance Parameter Estimates
Cov Parm
Subject
Estimate
Standard
Z Value
Pr Z
Error
Variance
nMD
0.2813
0.04826
5.83
<.0001
AR(1)
nMD
0.6921
0.05996
11.54
<.0001
... View more
05-19-2021
01:30 AM
Hi Dave,
Your idea makes sense. I have the appropriate changes to the estimate to the following statement and it works.
Thanks.
proc glimmix data=newadr_ge200_avg_2012_v2 noclprint method=laplace; class nMD procyear(ref=first); model adeno_yes(event=last)=procyear/cl dist=binary link=logit solution; random procyear/ sub=nMD type=ar(1) s CL; estimate "Year 2012" int 1 procyear 0 0 0 0 0 0 1/ ilink; estimate "Year 2013" int 1 procyear 1 0 0 0 0 0 0/ ilink; estimate "Year 2014" int 1 procyear 0 1 0 0 0 0 0/ ilink; estimate "Year 2015" int 1 procyear 0 0 1 0 0 0 0/ ilink; estimate "Year 2016" int 1 procyear 0 0 0 1 0 0 0/ ilink; estimate "Year 2017" int 1 procyear 0 0 0 0 1 0 0/ ilink; estimate "Year 2018" int 1 procyear 0 0 0 0 0 1 0/ ilink; run;
... View more
05-19-2021
01:28 AM
Hi Kathleen,
Thanks for your suggestions. I tried it, but it turned out the estimate cannot be estimated.
I believe that PROC GLIMMIX default is GLM coding for the class statement. What you have suggested is for effect coding for class statement which to my understanding is not available in PROC GLIMMIX.
... View more
05-17-2021
09:37 PM
Hi Steve, Thanks for your suggestions. It does seem to correct the problem. However, one thing I noticed is that when the ref group (2018 vs 2012 as reference) is changed, the mean results output seem to be slightly different. Why is this? I figure it should be the same, no? proc glimmix data=newadr_ge200_avg_2012_v2 noclprint method=laplace; class nMD procyear; model adeno_yes(event=last)=procyear/cl dist=binary link=logit solution; random procyear/ sub=nMD type=ar(1) s CL; lsmeans procyear/ ilink e; run; HTML clipboard Solutions for Fixed Effects Effect procyear Estimate Standard Error DF t Value Pr > |t| Alpha Lower Upper Intercept -0.3822 0.1366 231 -2.80 0.0056 0.05 -0.6514 -0.1130 procyear 2012 -1.0368 0.1557 231 -6.66 <.0001 0.05 -1.3435 -0.7302 procyear 2013 -0.9708 0.1420 231 -6.84 <.0001 0.05 -1.2506 -0.6910 procyear 2014 -0.8767 0.1284 231 -6.83 <.0001 0.05 -1.1298 -0.6237 procyear 2015 -0.7011 0.1139 231 -6.16 <.0001 0.05 -0.9254 -0.4768 procyear 2016 -0.3416 0.09702 231 -3.52 0.0005 0.05 -0.5328 -0.1505 procyear 2017 -0.05344 0.07212 231 -0.74 0.4594 0.05 -0.1955 0.08865 procyear 2018 0 . . . . . . . HTML clipboard Coefficients for procyear Least Squares Means Effect procyear Row1 Row2 Row3 Row4 Row5 Row6 Row7 Intercept 1 1 1 1 1 1 1 procyear 2012 1 procyear 2013 1 procyear 2014 1 procyear 2015 1 procyear 2016 1 procyear 2017 1 procyear 2018 1 HTML clipboard procyear Least Squares Means procyear Estimate Standard Error DF t Value Pr > |t| Mean Standard Error Mean 2012 -1.4190 0.1513 231 -9.38 <.0001 0.1948 0.02374 2013 -1.3530 0.1447 231 -9.35 <.0001 0.2054 0.02362 2014 -1.2589 0.1405 231 -8.96 <.0001 0.2212 0.02420 2015 -1.0833 0.1375 231 -7.88 <.0001 0.2529 0.02597 2016 -0.7238 0.1364 231 -5.31 <.0001 0.3265 0.02999 2017 -0.4356 0.1350 231 -3.23 0.0014 0.3928 0.03221 2018 -0.3822 0.1366 231 -2.80 0.0056 0.4056 0.03294 However, if I put ref=first to indicate 2012 as reference group proc glimmix data=newadr_ge200_avg_2012_v2 noclprint method=laplace; class nMD procyear*(ref=first)*/; model adeno_yes(event=last)=procyear/cl dist=binary link=logit solution; random procyear/ sub=nMD type=ar(1) s CL; lsmeans procyear/ ilink e; run; HTML clipboard Solutions for Fixed Effects Effect procyear Estimate Standard Error DF t Value Pr > |t| Alpha Lower Upper Intercept -1.2370 0.1397 231 -8.85 <.0001 0.05 -1.5123 -0.9616 procyear 2013 -0.1178 0.1549 231 -0.76 0.4476 0.05 -0.4230 0.1873 procyear 2014 -0.02350 0.1440 231 -0.16 0.8705 0.05 -0.3072 0.2602 procyear 2015 0.1533 0.1328 231 1.15 0.2494 0.05 -0.1083 0.4149 procyear 2016 0.5146 0.1218 231 4.23 <.0001 0.05 0.2746 0.7545 procyear 2017 0.8057 0.1076 231 7.48 <.0001 0.05 0.5936 1.0178 procyear 2018 0.8671 0.09087 231 9.54 <.0001 0.05 0.6880 1.0461 procyear 2012 0 . . . . . . . HTML clipboard Coefficients for procyear Least Squares Means Effect procyear Row1 Row2 Row3 Row4 Row5 Row6 Row7 Intercept 1 1 1 1 1 1 1 procyear 2013 1 procyear 2014 1 procyear 2015 1 procyear 2016 1 procyear 2017 1 procyear 2018 1 procyear 2012 1 HTML clipboard procyear Least Squares Means procyear Estimate Standard Error DF t Value Pr > |t| Mean Standard Error Mean 2013 -1.3548 0.1439 231 -9.41 <.0001 0.2051 0.02347 2014 -1.2605 0.1390 231 -9.07 <.0001 0.2209 0.02392 2015 -1.0837 0.1354 231 -8.01 <.0001 0.2528 0.02557 2016 -0.7224 0.1337 231 -5.40 <.0001 0.3269 0.02941 2017 -0.4313 0.1313 231 -3.28 0.0012 0.3938 0.03135 2018 -0.3699 0.1313 231 -2.82 0.0053 0.4086 0.03172 2012 -1.2370 0.1397 231 -8.85 <.0001 0.2250 0.02437
... View more
05-17-2021
12:36 AM
Hi,
So I am having problems with estimate statement in proc glimmix.
I have the following proc glimmix:
proc glimmix data=newadr noclprint method=laplace; class nMD procyear(ref=first); model adeno_yes(event=last)=procyear/cl dist=binary link=logit solution; random procyear/ sub=nMD type=ar(1) s CL; estimate "Year 2012" int 1 procyear 1 0 0 0 0 0 0/ ilink; estimate "Year 2013" int 1 procyear 0 1 0 0 0 0 0/ ilink; estimate "Year 2014" int 1 procyear 0 0 1 0 0 0 0/ ilink; estimate "Year 2015" int 1 procyear 0 0 0 1 0 0 0/ ilink; estimate "Year 2016" int 1 procyear 0 0 0 0 1 0 0/ ilink; estimate "Year 2017" int 1 procyear 0 0 0 0 0 1 0/ ilink; estimate "Year 2018" int 1 procyear 0 0 0 0 0 0 1/ ilink; run;
My procyear variable has the following values: 2012, 2013, 2014, 2015, 2016, 2017, 2018
The output is parameter estimates are:
Solutions for Fixed Effects
Effect
procyear
Estimate
Standard Error
DF
t Value
Pr > |t|
Alpha
Lower
Upper
intercept
-1.2370
0.1397
231
-8.85
<.0001
0.05
-1.5123
-0.9616
procyear
2013
-0.1178
0.1549
231
-0.76
0.4476
0.05
-0.4230
0.1873
procyear
2014
-0.02350
0.1440
231
-0.16
0.8705
0.05
-0.3072
0.2602
procyear
2015
0.1533
0.1328
231
1.15
0.2494
0.05
-0.1083
0.4149
procyear
2016
0.5146
0.1218
231
4.23
<.0001
0.05
0.2746
0.7545
procyear
2017
0.8057
0.1076
231
7.48
<.0001
0.05
0.5936
1.0178
procyear
2018
0.8671
0.09087
231
9.54
<.0001
0.05
0.6880
1.0461
procyear
2012
0
.
.
.
.
.
.
.
The output I got for the estimate statement is:
Estimates
Label
Estimate
Standard Error
DF
t Value
Pr > |t|
Mean
Standard Error Mean
Year 2012
-1.3548
0.1439
231
-9.41
<.0001
0.2051
0.02347
Year 2013
-1.2605
0.1390
231
-9.07
<.0001
0.2209
0.02392
Year 2014
-1.0837
0.1354
231
-8.01
<.0001
0.2528
0.02557
Year 2015
-0.7224
0.1337
231
-5.40
<.0001
0.3269
0.02941
Year 2016
-0.4313
0.1313
231
-3.28
0.0012
0.3938
0.03135
Year 2017
-0.3699
0.1313
231
-2.82
0.0053
0.4086
0.03172
Year 2018
-1.2370
0.1397
231
-8.85
<.0001
0.2250
0.02437
I'm not sure this makes sense. Based on my estimate statement, I am expecting estimates to be:
year 2012 -1.2370
year 2013 -1.3548
year 2014 -1.2605
year 2015 -1.0837
year 2016 -0.7224
year 2017 -0.4313
year 2018 -0.3699
It seems like it is off by a year. What am I doing wrong here?
Thanks for your help.
... View more
12-19-2020
12:52 AM
Hi Steve, I tried it as proc genmod data=workdata.all_combined; model adr=/dist=binomial link=logit; run; ADR = percentage (procedures with polyps/total procedures) I get the following error. ERROR: The response variable ADR has 150 levels. A binary response must have two levels. ERROR: No valid observations due to invalid or missing values in the response, explanatory, offset, frequency, or weight variable. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE GENMOD used (Total process time): real time 0.08 seconds What am I doing wrong here?
... View more
12-14-2020
02:26 AM
Hi,
I was wondering what is the correct regression procedure to use if I have a percentage as an continuous outcome (obviously bounded between 0-1). It is number of procedure with polyps over number of total procedures done. My understanding is that this can be used with either binomial like proc genmod with logit link with binomial distribution or proc logistic. However, I also read is that using proc glimmix with beta distribution is the one to use.
Which one is the correct one to use?
Thanks.
... View more
12-07-2020
09:53 AM
Hi Chris,
Thanks for your response.
However, I am doing this in a data step and not under proc sql.
I have several other select-when statements in my data step, so I like to be able to do it in my data step.
Is there a way to do this?
Example:
Data two;
set one;
select; when (scope_number_or like "24%", scope_number_or like "25%", scope_number_or like "26%", scope_number_or like "%27") HDscope=0; when (scope_number_or like "N/A") HDscope=.; otherwise HDscope=1; end;
run;
... View more
12-07-2020
01:00 AM
Hi, I have a character variable scope_number_or and I like to categorize into a numeric variable HDscope. I like categorize scope_number_or by looking at substring of characters (like ones that start with 24, 25, 26 and ends with 27) and I tried using 'like' operator in my select-when statement, but 'like' operator does not seem to work. Is there a way to do this in a select-when statement? select; when (scope_number_or like "24%", scope_number_or like "25%", scope_number_or like "26%", scope_number_or like "%27") HDscope=0; when (scope_number_or like "N/A") HDscope=.; otherwise HDscope=1; end;
... View more
09-09-2020
12:41 AM
1 Like
Hi Chris, Believe it or not. I tried hhinohar's dosubl It actually works. Well, at least one thing is for sure after this, I need to read up on how to better use SAS macro. Thanks for your help working through this. My technique is ugly. I wish it was more elegant.
... View more