Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Obtaining calculcated percentage from proc miananalyze

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-06-2018 02:56 PM
(872 views)

Hi, I have a dataset with 5 groups where I needed to impute some missing observations. I want to make a contingency table (on all subjects with and without imputed values) giving the distribution in absolute number and percentage of some variables of interest by group (proc freq table with chisq test if I had no missing data).

So far, I have been able to get a test for between group differences and groupwise estimates for difference from the reference group using the code below. But how can I get an estimate of the calculated percentages from proc mianalyze in each group?

I tried to ask for lsmeans in proc logistic but get the error:

WARNING: The model does not have a GLM parameterization. This parameterization is required for

the LSMEANS, LSMESTIMATE, and SLICE statement. These statements are ignored

Any help would be much appreciated. Thanks!

Here is my full code:

proc surveyimpute data=have method=hotdeck(selection=abb)

ndonors=5 seed=773269;

var x1 x2 x3 x4 x5;

cells imputecell;

output out=ABB;

id id;

run;

data DAIMP;

set ABB;

if (ImpIndex = 0) then do;

do _Imputation_=1 to 5;

output;

end;

end;

else do;

_Imputation_ = ImpIndex;

output;

end;

proc sort data=DAIMP;

by _Imputation_ ImpIndex;

run;

ods select none;

proc surveylogistic data=DAIMP;

by _imputation_;

class treatment group;

model treatment=group / covb;

ods output parameterestimates=Estimates covb=Covariances;

run;

ods select all;

proc mianalyze parms(classvar=classval)=Estimates

covb(effectvar=stacking)=Covariances

edf=25;

class group;

modeleffects Intercept group;

ods output parameterestimates=ABBLogisticAnalysis;

run;

ods select none;

proc logistic data=DAIMP;

class group(order=internal);

model treatment(event='1')= group / covb; /* this gives at test for between group differences in treatment with

by _Imputation_;

ods output ParameterEstimates=lgsparms;

run;

ods select all;

proc mianalyze parms(classvar=classval)=lgsparms;

modeleffects group;

run;

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I did face this same problem when I was working on a project. The reason why mianalyze does not give a single estimate for percentage across imputations is that percentage calculations do not have a standard error.

What you could do instead is to report the percentage across all n (number) imputations (removing the by statement in your proc freq code). But you cannot report # observations in each group still. Hope it helps.

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

For the error that you are receiving in logistic you can use param=GLM in the class statement.

1. Pasta DJ. Parameterizing Models to Test the Hypotheses You Want: Coding Indicator Variables and Modified Continuous Variables. http://www2.sas.com/proceedings/sugi30/212-30.pdf. Accessed December 6, 2018.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks. But SAS won't estimate calculated percentages because there are no standard error estimates on the reference group. Proc freq might be a solution using something like this:

ods trace on;

proc freq data=DAIMP;

table treatment*group / CROSSLIST(STDRES);

by _Imputation_;

run;

ods trace off;

But how can I get the calculated #observations and percentages of treatment*group from proc mianalyze?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I did face this same problem when I was working on a project. The reason why mianalyze does not give a single estimate for percentage across imputations is that percentage calculations do not have a standard error.

What you could do instead is to report the percentage across all n (number) imputations (removing the by statement in your proc freq code). But you cannot report # observations in each group still. Hope it helps.

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.