a week ago
SAS_Rob
SAS Employee
Member since
07-21-2017
- 444 Posts
- 9 Likes Given
- 110 Solutions
- 340 Likes Received
-
Latest posts by SAS_Rob
Subject Views Posted 382 a week ago 395 a week ago 377 3 weeks ago 289 02-21-2025 05:30 PM 359 02-19-2025 11:41 AM 379 02-19-2025 11:10 AM 743 02-11-2025 03:54 PM 765 02-11-2025 03:44 PM 455 02-11-2025 01:16 PM 815 01-29-2025 11:00 AM -
Activity Feed for SAS_Rob
- Posted Re: Troubleshooting PROC MI differences when trying to replicate on Statistical Procedures. a week ago
- Posted Re: Troubleshooting PROC MI differences when trying to replicate on Statistical Procedures. a week ago
- Got a Like for Re: trend p-value using the Cochran-Armitage test. 3 weeks ago
- Got a Like for Re: trend p-value using the Cochran-Armitage test. 3 weeks ago
- Posted Re: trend p-value using the Cochran-Armitage test on Statistical Procedures. 3 weeks ago
- Got a Like for Re: Joint test in PROC FMM?. 02-28-2025 08:11 AM
- Got a Like for Re: Proc MI. 02-28-2025 08:09 AM
- Got a Like for Re: Proc MI. 02-21-2025 09:15 PM
- Posted Re: Proc MI on Statistical Procedures. 02-21-2025 05:30 PM
- Posted Re: Joint test in PROC FMM? on Statistical Procedures. 02-19-2025 11:41 AM
- Posted Re: Joint test in PROC FMM? on Statistical Procedures. 02-19-2025 11:10 AM
- Got a Like for Re: How can I get coefficient 3 categories (not ordered) dependent var. 02-12-2025 01:42 PM
- Got a Like for Re: PROC MCMC, Can I Obtain LSMean Statements Without Running PROC MIXED?. 02-12-2025 01:40 PM
- Posted Re: How can I get coefficient 3 categories (not ordered) dependent var on Statistical Procedures. 02-11-2025 03:54 PM
- Posted Re: How can I get coefficient 3 categories (not ordered) dependent var on Statistical Procedures. 02-11-2025 03:44 PM
- Posted Re: PROC MCMC, Can I Obtain LSMean Statements Without Running PROC MIXED? on Statistical Procedures. 02-11-2025 01:16 PM
- Got a Like for Re: Combining LSMEANS Output. 01-29-2025 02:02 PM
- Got a Like for Re: Combining LSMEANS Output. 01-29-2025 02:01 PM
- Got a Like for Re: Proc Surveylogistic Link=Glogit: Are the "Odds Ratio Estimates" actually Relative Risk. 01-29-2025 01:51 PM
- Posted Re: Exact Bionomial CI with Summary Data on Statistical Procedures. 01-29-2025 11:00 AM
-
Posts I Liked
Subject Likes Author Latest Post 5 2 1 1 3 -
My Liked Posts
Subject Likes Posted 3 3 weeks ago 2 02-19-2025 11:41 AM 4 02-21-2025 05:30 PM 1 02-11-2025 03:44 PM 1 02-11-2025 01:16 PM
a week ago
To be clear then, the data sets are identical in all the variables--trt,baseline, week6, week12, week18, week24 and in the same order with missing values on the same observations?
If you can add the SIMPLE option to the MI statement and post its output along with the Missing Data Patterns output, then that might be helpful.
... View more
a week ago
It isn't clear what you mean when you say that the data sets are different, but the observations are the same. Can you elaborate what exactly is different and what exactly is the same in the two cases? Also, could you post the two sets of codes you are using?
... View more
3 weeks ago
3 Likes
You have all the information you need. You will just need to restructure your data set like the following:
data test;
input Group Successes Total;
cards;
1 20 500
2 30 1000
3 40 500
;
run;
data test2;
set test;
resp='y';ct=successes;output;
resp='n';ct=total-successes;output;
run;
proc freq data=test2 order=data;
weight ct;
tables resp*group/trend;
run;
... View more
02-21-2025
05:30 PM
4 Likes
The long format is not usually compatible with performing multiple imputation, thus data restructuring from long to wide or the reverse is often needed for multiple imputation. There is a good discussion in Raghunathan's Missing Data in Practice text (2016) pages 121-126 and in the 2018 paper linked below.
Using SAS for Multiple Imputation and Analysis of Longitudinal Data
... View more
02-19-2025
11:41 AM
2 Likes
No, you are interpreting it correctly. I was wrong about what was contained in that data set.
In any regard, hypothesis testing in finite mixture models is not very well defined because it is difficult if not impossible to derive the asymptotic distribution for the mixture likelihood. There is a paper that discusses the problem and makes a few suggestions related to goodness of fit tests that might work. Anything that they propose would not be available in SAS, but you might be able to program it yourself.
Hypothesis testing for finite mixture models - ScienceDirect
... View more
02-19-2025
11:10 AM
The problem is the FMM does not report a covariance matrix for the estimates of the PROBMODEL. This would make performing a joint test impossible.
... View more
02-11-2025
03:54 PM
The EDF= option is set to 328 which is the number of observations (338) minus the number of parameters (10).
... View more
02-11-2025
03:44 PM
1 Like
There is no way to combine the odds ratios directly since there is not a reported standard error. Instead you must combine the parameter estimates and then use a Data Step to compute the odds ratios. Below is an example similar to your setup.
data school;
length Program $ 9;
input School Program $ Style $ NumStudent Count @@;
datalines;
1 regular self 21 10 1 regular team 22 17 1 regular class 16 26
1 afternoon self 23 5 1 afternoon team 26 12 1 afternoon class 21 50
2 . self 22 21 2 regular team 31 17 2 regular class 32 26
2 . . 18 16 2 afternoon team 28 12 2 afternoon class 27 36
3 regular self 14 15 3 regular team 32 15 3 regular class 31 16
3 afternoon self 19 12 3 afternoon team 30 12 3 . class 33 20
;
proc mi data=school out=school_imp;
freq count;
class school style program;
var NumStudent school style program;
monotone discrim (style=NumStudent);
monotone logistic (program=school style);
title 'Proc MI results for monotone Logistic model';
run;
proc logistic data=school_imp;
by _imputation_;
freq Count;
class School Program(ref=first)/param=ref;
model Style(order=data)=School Program NumStudent / link=glogit;
ods output ParameterEstimates=imp_parms;
run;
proc mianalyze parms(classvar=classval link=glogit)=imp_parms edf=328;
class school program;
modeleffects intercept school program numstudent;
ods output parameterestimates=mianalyze_parms;
run;
data OR;
set mianalyze_parms(where=(parm ne 'intercept'));
OR=exp(estimate);
LCL_OR=exp(LCLMean);
UCL_OR=exp(UCLMean);
proc print;
var parm school program response OR LCL_OR UCL_OR;
run;
... View more
02-11-2025
01:16 PM
1 Like
You would need to create a data set with the coefficients in them and then use the PREDDIST statement with the COVARIATES= option.
I am not sure how the priors would change the coefficients as those are meant to be just a linear combination of the parameters applied to the posterior predictive distribution.
... View more
01-29-2025
11:00 AM
You only have a single response level for each combination the way the data is now. For example, notice how in Visit=1, Group=1, Subgroup=A there is only one level to the response, 1. This is the case for all the subtables. If this is not what you are expecting, then it might be the way that you entered the data in. What exactly should each subtable look like?
... View more
01-28-2025
08:15 AM
1 Like
The theory behind multiply imputed data only takes estimates and their standard errors and gives combined estimates. It does not lend itself to combining confidence intervals or p-values (adjusted or unadjusted). My suggestion would be to combine the estimates using MIANALYZE like shown and then save the p-values to a SAS data set. You could then use on the p-value adjustment methods available in Proc MULTTEST.
Note that not all the p-value adjustment methods are available in MULTTEST that are in GLIMMIX.
SAS Help Center: PROC MULTTEST Statement
data outmi;
do _imputation_=1 to 3;
do trt='test','trt1','trt2','trt3';
do rep=1 to 10;
trtn+1;
y=1.3+.18*trtn+rannor(123);
output;
end; end; end;
run;
proc glimmix data=outmi;
by _imputation_;
class trt;
model y=trt;
lsmeans trt/diff;
ods output diffs=diff;
run;
data diff2;
set diff;
comparison=trt||' vs '||left(_trt);
run;
proc sort data=diff2;
by comparison _imputation_;
run;
proc mianalyze data=diff2;
by comparison;
modeleffects estimate;
stderr stderr;
ods output ParameterEstimates=estimate_ds(rename=(probt=raw_p comparison=test));
run;
proc multtest inpvalues=estimate_ds holm hoc fdr bon;
run;
... View more
01-27-2025
07:55 PM
3 Likes
The approach should be the same as it is in Proc MIXED. See the example in the usage note below. https://support.sas.com/kb/30/715.html
... View more
01-21-2025
09:31 AM
1 Like
Based on the description you gave, the code appears to be correct.
The reported odds ratios are actually odds ratios. When you use the default effects coding for the CLASS variables then the OR are no longer calculated as Exp(Beta). The LOGISTIC documentation has some further details on this:
SAS Help Center: Odds Ratio Estimation
As far as calculating the relative risk is concerned you should be able to use the approach detailed in this usage note. The only difference would obviously be that you would use SURVEYLOGISTIC instead of LOGISTIC. Using the STORE statement in SURVEYLOGISTIC should be sufficient for getting the MACRO all that it needs.
57798 - Estimating relative risks in a multinomial response model
... View more
01-14-2025
12:24 PM
1 Like
Given the information you shared, it *might* be appropriate to use the CLUSTER statement. Not knowing the survey design makes it difficult to know for sure.
... View more
01-14-2025
08:36 AM
What is the sampling design you are working with and what is your current SURVEYLOGISTIC code?
... View more