yesterday
SAS_Rob
SAS Employee
Member since
07-21-2017
- 432 Posts
- 9 Likes Given
- 106 Solutions
- 324 Likes Received
-
Latest posts by SAS_Rob
Subject Views Posted 37 yesterday 168 a week ago 186 a week ago 286 12-16-2024 10:05 AM 239 11-19-2024 10:03 AM 1470 11-19-2024 09:55 AM 1613 11-18-2024 08:28 AM 434 09-30-2024 08:45 AM 1354 09-09-2024 10:25 AM 570 08-29-2024 02:07 PM -
Activity Feed for SAS_Rob
- Posted Re: Proc Surveylogistic Link=Glogit: Are the "Odds Ratio Estimates" actually Relative Risk on Statistical Procedures. yesterday
- Got a Like for Re: PROC SURVEYLOGISTIC with clustered/correlated data. Friday
- Posted Re: PROC SURVEYLOGISTIC with clustered/correlated data on Statistical Procedures. a week ago
- Posted Re: PROC SURVEYLOGISTIC with clustered/correlated data on Statistical Procedures. a week ago
- Posted Re: Strata statement in surveyfreq for case-cohort data on Statistical Procedures. 12-16-2024 10:05 AM
- Got a Like for Re: Imputation. 11-27-2024 02:53 AM
- Got a Like for Re: proc fmm. 11-19-2024 12:38 PM
- Got a Like for Re: proc fmm. 11-19-2024 10:39 AM
- Posted Re: proc fmm on Statistical Procedures. 11-19-2024 10:03 AM
- Posted Re: Running R code through SAS IML error: stats package unable to load - execution error on SAS/IML Software and Matrix Computations. 11-19-2024 09:55 AM
- Posted Re: Running R code through SAS IML error: stats package unable to load - execution error on SAS/IML Software and Matrix Computations. 11-18-2024 08:28 AM
- Posted Re: The MIANALYZE Procedure on Statistical Procedures. 09-30-2024 08:45 AM
- Posted Re: Proc GEE (Multinominal Outcome) - Estimate Statement on Statistical Procedures. 09-09-2024 10:25 AM
- Got a Like for Re: Error with PROC MIANALYZE after regression. 09-01-2024 10:50 AM
- Posted Re: Error with PROC MIANALYZE after regression on Statistical Procedures. 08-29-2024 02:07 PM
- Posted Re: how to use the macro after the imputation? on Statistical Procedures. 08-29-2024 11:07 AM
- Posted Re: Running R code through SAS IML error: stats package unable to load - execution error on SAS/IML Software and Matrix Computations. 08-21-2024 04:12 PM
- Got a Like for Re: Error with PROC MIANALYZE (Multiple Imputation Analysis Error Message). 08-18-2024 08:49 PM
- Posted Re: Imputation on Statistical Procedures. 08-18-2024 06:35 PM
- Posted Re: Error with PROC MIANALYZE (Multiple Imputation Analysis Error Message) on Statistical Procedures. 08-18-2024 06:27 PM
-
Posts I Liked
Subject Likes Author Latest Post 5 2 1 1 3 -
My Liked Posts
Subject Likes Posted 1 a week ago 1 08-18-2024 06:35 PM 3 11-19-2024 10:03 AM 1 08-29-2024 02:07 PM 2 08-18-2024 06:27 PM
yesterday
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
a week ago
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
12-17-2024
02:41 PM
As a simpler hypothetical, what if I have a stratified random sample, and the stratification variables are sex and age. In this study, we oversampled girls and younger ages so we would have enough N to look at age-related differences in a binary outcome. I sampled with known probability so I also have weights. If I need a crosstab of age by outcome, do I include both sex and age in the strata statement of the surveyfreq? Why won't surveyfreq let me add age to the strata statement if it is also in the Tables statement.
... View more
12-04-2024
10:06 AM
Just an update, I was able to install the suggested hotfix and it did not solve the error with R 4.4. I am still receiving the same message at the top of this thread. R 4.4 is working fine otherwise.
... View more
11-19-2024
10:03 AM
3 Likes
Yes, you could test for overdispersion by using the Pearson/DF. The second message is an indication that the model did not converge. A suggestion would be to simplify the model and add complexity back from there.
... View more
09-30-2024
09:59 AM
@Alan68022 wrote:
I'm curious if you got this to work. I have the same question. I need to use the R package called SANON. I can get all the imputed data sets into SANON. With a loop, SANON will output the estimate and SE for each data set. How do I format the output data to read into MIANALYZE?
Apparently the original poster that started this thread has not posted any activity on the forum for more than five years now.
I would suggest starting your own thread and provide some details, such as providing versions of YOUR data files or sets.
Also, as thread creator you have the ability to mark answers as correct.
... View more
08-29-2024
09:07 PM
https://support.sas.com/kb/62/362.html Check it at bottom of URL. %macro code; %nlmeans(instore=nb, coef=c, link=log, where=&_BY1=&_LVL1, options=nonames noprint, title=rate diffs) data est; set est; _imputation_=&_LVL1; run; proc append base=alldiff data=est; run; %mend; %runby(data=imput, by=_imputation_)
... View more
08-29-2024
02:07 PM
1 Like
There are two issues that need to be addressed in addition to the ERROR message. Your MODELEFFECTS statement should list the parameters on it and there should not be a STDERR statement when you use the PARMS= data set.
Secondly, you should use a BY statement for the _IMPUTATION_ and only list RaceEthnicity on the DOMAIN statement.
Regarding the ERROR message, because of the way that SURVEYREG codes CLASS variables it is necessary to remove all blanks from the variable Parameter before feeding it into MIANALYZE. You will then need to check the names of the effects in that data set (using a Proc PRINT) by placing them on the MODELEFFECTS statement . You will also need to sort the output data set since you will need to run MIANALYZE by the domain variable.
If your goal is to also combine your ESTIMATE statement, then you will need another call to MIANALYZE (with another Proc SORT).
Below is an example that shows all of the steps for combining both the Parameter Estimates and Estimate statements when you use a DOMAIN statement in SURVEYREG.
/*This assumes that the imputation has already been done*/
data farms;
do _imputation_=1 to 3;
do domainvar=1 to 3;
do state=1 to 2;
do region=1 to 3;
do rep=1 to 5;
farmarea=ceil(ranuni(323)*100);
cornyield=.66+.95*state+.65*farmarea+rannor(3214);
weight=ceil(ranuni(0)*10);
output;
end;
end;
end;
end;
end; run;
proc surveyreg data=Farms;
by _imputation_;
domain domainvar;
class region;
strata State ;
model CornYield = region FarmArea /solution;
weight Weight;
estimate 'Region 1 vs Region 2' region 1 -1;
estimate 'Region 1 vs Region 3' region 1 0 -1;
ods output parameterestimates=parms estimates=estimate_ds;;
run;
/*Because of the way that SURVEYREG codes CLASS variables it is necessary to
remove all blanks from the variable Parameter*/
data parms;
set parms;
parameter=compress(parameter);
run;
/*This shows how the Parameters are now labeled for the MODELEFFECTS statement*/
proc print data=parms(obs=5);
var parameter;
run;
proc sort data=parms;
by domainvar _imputation_;
run;
proc mianalyze parms=parms;
by domainvar;
modeleffects intercept region1 region2 farmarea;
run;
proc sort data=estimate_ds;
by label domain _imputation_;
run;
proc mianalyze data=estimate_ds;
by label domain;
modeleffects estimate;
stderr stderr;
run;
... View more
08-26-2024
07:24 AM
Hi there! 👋 You're absolutely right to be cautious about using Wald intervals, especially when dealing with small sample sizes and zero counts. The Agresti-Caffo method is a great alternative in these situations, as it can handle zero counts and tends to provide more reliable estimates when sample sizes are small (n < 10). I recently wrote a detailed article on this topic, where I explain the Agresti-Caffo method, including its SAS implementation. In the article, I also provide a step-by-step example with SAS code and discuss the interpretation of the results. This should be particularly useful for your scenario of calculating relative risk and risk difference along with their 95% confidence intervals. You can find the article here: Agresti-Caffo Implementation in SAS The method works well for small sample sizes and when dealing with zero counts, so it could be exactly what you're looking for. Feel free to check it out and let me know if you have any further questions! Best of luck with your analysis! 😊
... View more
08-18-2024
06:35 PM
1 Like
I believe that if you check the LOG you will see an explanation for the missing results in the form of a WARNING about the between imputation variance being zero.
The message you are receiving can have a number of possible causes. The first is that there is some problem with the imputation model itself (I have seen where people have left the response variable off the VAR statement in Proc MI as an example). In general though it occurs when the missing data has no influence on the sampling error of a parameter estimate. There is no fix or adjustment for that, but it does require some further investigation on your part. Usually it is an indication of a problem with the imputation model with possible causes ranging from a poor imputation model to no real need to impute due to a very small fraction of missing information
Without fixing the problem, when the between imputation variance is zero then the number of Degrees of Freedom is undefined so you cannot get a confidence interval or p-values. If you are unable to determine the cause then one suggestion would be that, if there are only minimum differences among these within-imputation variances, then look at the results for that variable for one of the imputations.
... View more
08-18-2024
06:27 PM
2 Likes
You should remove the data step in between SURVEYLOGISTIC and MIANALYZE as it is causing the issue because you are using PARAM=GLM which has a missing standard error. This step is unnecessary if you use the CLASS statement in MIANALYZE along with the CLASSVAR=CLASSVAL sub-option.
proc mianalyze parms(classvar=classval)=a_mvn;
class SexualOrientationSex RaceEthnicity Education IncomePovertyRatio BMICategory HealthInsurance URBRRL REGION;
MODELEFFECTS INTERCEPT AGEP_A SexualOrientation Sex RaceEthnicity Education IncomePovertyRatio BMICategory HealthInsurance URBRRL REGION;
run;
... View more
08-06-2024
11:29 AM
Hello,
Did you finally find a solution to this warning?
... View more
08-06-2024
08:43 AM
A point of clarification might help. Typically, we refer to prior distributions of parameters and not of effects. When an effect can be measured by a single parameter (like in a main effects only model) then these terms could be used somewhat interchangeably. When you have an interaction, there is not a single parameter that captures the effect and so you cannot use the terms in that manner.
More to the point, the model you are fitting assumes that there is not a single treatment effect, but instead the effect depends upon the visit number. Thus there is not a single effect.
... View more
08-05-2024
11:35 AM
It would be relatively straightforward to perform a test for the linear trend in the Log(odds) by using a CONTRAST (or ESTIMATE) statement and the approach detailed in this usage note for Proc GLM. If you were to use PARAM=GLM on the CLASS statement then you should be able to use this methodology to generate the proper coefficients for the CONTRAST statement. http://support.sas.com/kb/22/912.html
... View more