<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem with proc mianalyze after the proc surveyphreg was performed in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508784#M26101</link>
    <description>&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help. I changed the code as suggested:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data gentemp.parms_class; 
set gentemp.surveyphregest;
grp = scan(parameter,2,' ');
if grp='' then effect=parameter;
else effect = 'grp';
run;

proc mianalyze parms (CLASSVAR=full)=gentemp.parms_class edf=42;
	class race_f  gender_f 
      	  flag_rehospNONsk flag_rehospSk ICH
          type_fstrehab
          f_base_CollegeandAbove  f_base_married 
          f_base_insurance f_base_meanImputedIncomeCat 
          HEbeforeSKIPindex ;
	modeleffects        race_f gender_f age_skIPindex 
                        /*var from the initial ip clm */
                        flag_rehospNONsk flag_rehospSk ICH 
                        complicationIndex_IP ProcedureIndex_IP LOS_InitialIP 
						/*var from the first rehab*/
						type_fstrehab LOS_fstrehab 
                        complicationIndex_fstrehab 
						/*var from the transition dataset*/
						transition_number
						/*var from the thearpy estimates, only 90-day agg is needed*/  
						sum_therapy_mins_90day
                        /*var from the beneficiary cc file*/
						comorbidityIndex
						/*nhats baseline vars*/
                        f_base_CollegeandAbove  f_base_married  f_base_insurance f_base_meanImputedIncomeCat f_base_networkcount HEbeforeSKIPindex 
						;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is an error message:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Variable race_f is not in the PARMS= data set.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the&amp;nbsp;gentemp.parms_class dataset, the value of the variable grp is "Black", the value of the variable effect is 'grp'. I wonder if there is any solution to the new problem. Thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 16:03:05 GMT</pubDate>
    <dc:creator>Crystal_F</dc:creator>
    <dc:date>2018-10-30T16:03:05Z</dc:date>
    <item>
      <title>problem with proc mianalyze after the proc surveyphreg was performed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508717#M26097</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a survey dataset with missing values on two categorical variables : f_base_meanImputedIncomeCat and f_base_CollegeandAbove(15%). In the multiple imputation step, i ran the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mi data=final.model1and2_clean seed=875 nimpute=5 out=temp.outfcs ;
class race_f gender_f f_base_married f_base_insurance  f_base_meanImputedIncomeCat f_base_CollegeandAbove; 
fcs logistic ( f_base_meanImputedIncomeCat f_base_CollegeandAbove ) ;
var age_skIPindex race_f gender_f f_base_married f_base_insurance  f_base_meanImputedIncomeCat f_base_CollegeandAbove ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I got warning message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WARNING: The covariates are not specified in an FCS discriminant method for variable race_f, only remaining continuous
         variables will be used as covariates with the default CLASSEFFECTS=EXCLUDE option.
WARNING: The covariates are not specified in an FCS discriminant method for variable gender_f, only remaining continuous
         variables will be used as covariates with the default CLASSEFFECTS=EXCLUDE option.
WARNING: The covariates are not specified in an FCS discriminant method for variable f_base_Married, only remaining continuous
         variables will be used as covariates with the default CLASSEFFECTS=EXCLUDE option.
WARNING: The covariates are not specified in an FCS discriminant method for variable f_base_Insurance, only remaining
         continuous variables will be used as covariates with the default CLASSEFFECTS=EXCLUDE option.
WARNING: The maximum likelihood estimates for the logistic regression with observed observations may not exist for variable
         f_base_CollegeandAbove. The posterior predictive distribution of the parameters used in the imputation process is
         based on the maximum likelihood estimates in the last maximum likelihood iteration.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As I don't need to impute all other categorical variables, I assumed this would be fine and moved on to the next step, i.e. using the imputed data set to run the cox model with a survey dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;&lt;BR /&gt;value college&lt;BR /&gt;0='Less than college'&lt;BR /&gt;1='College and above'&lt;BR /&gt;;&lt;BR /&gt;run;

proc format;
value Insurance
0='Just Medicare'
1='Medicaid'
2='Any other supplemental insurance'
;
run;

proc format;
value meanIncome
1 ="Less than $12,102" 
2 ="$12,102-$21,000" 
3 ="$21,001-$34,409" 
4 ="$34,410-$60,000" 
5 ="$60,001+"
;
run;

proc format;
value race
1="White"
2="Black"
;
run;


proc format;
value gender
1="Male"
2="Female"
;
run;


proc surveyphreg data = temp.outfcs;
format race_f race.;
format gender_f gender.;
format f_base_insurance insurance.;
format f_base_meanImputedIncomeCat meanIncome.;
format f_base_CollegeandAbove college.;

weight Int_baseweight;
strata varstrat;
cluster varunit;

class race_f(ref='White') gender_f (ref='Male')
      flag_rehospNONsk(ref='0') flag_rehospSk(ref='0') ICH (ref='0')
      type_fstrehab(ref='Non')
      f_base_CollegeandAbove(ref='Less than college')  f_base_married(ref='0')  
      f_base_insurance(ref='Just Medicare') f_base_meanImputedIncomeCat (ref='$60,001+') 
      HEbeforeSKIPindex (ref='0') / param=ref;
model lenfol_IP*censor_death_f(0) = race_f gender_f age_skIPindex 
                        
                        flag_rehospNONsk flag_rehospSk ICH 
                        complicationIndex_IP ProcedureIndex_IP LOS_InitialIP 
						
						type_fstrehab LOS_fstrehab 
                        complicationIndex_fstrehab 
						
						transition_number
						
						sum_therapy_mins_90day
                        
						comorbidityIndex
						
                        f_base_CollegeandAbove  f_base_married  f_base_insurance f_base_meanImputedIncomeCat f_base_networkcount HEbeforeSKIPindex / risklimit
						;
ods output parameterEstimates  = gentemp.surveyphregest; 
by _imputation_;

run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It seemed fine at this point:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: The BY statement provides completely separate analyses of the BY groups.  It does not provide a statistically valid
      subpopulation or domain analysis, where the total number of units in the subpopulation is not known with certainty. If
      you want a domain analysis, you should include the DOMAIN variables in a DOMAIN statement.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: At least one element of the gradient is greater than 1e-3.
WARNING: Stratum level 3 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 8 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 11 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 26 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 30 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 43 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 44 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 46 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 48 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
WARNING: Stratum level 50 contains only a single cluster. Single-cluster strata are not included in the variance estimates.
NOTE: The above message was for the following BY group:
      Imputation Number=1
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: At least one element of the gradient is greater than 1e-3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I got error message after the the following code was run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mianalyze parms (CLASSVAR=CLASSVAL)=gentemp.surveyphregest edf=42;
	class race_f  gender_f 
      	  flag_rehospNONsk flag_rehospSk ICH
          type_fstrehab
          f_base_CollegeandAbove  f_base_married 
          f_base_insurance f_base_meanImputedIncomeCat 
          HEbeforeSKIPindex ;
	modeleffects        race_f gender_f age_skIPindex 
                        flag_rehospNONsk flag_rehospSk ICH 
                        complicationIndex_IP ProcedureIndex_IP LOS_InitialIP 
						type_fstrehab LOS_fstrehab 
                        complicationIndex_fstrehab 
						transition_number
						sum_therapy_mins_90day
						comorbidityIndex
                        f_base_CollegeandAbove  f_base_married  f_base_insurance f_base_meanImputedIncomeCat f_base_networkcount HEbeforeSKIPindex 
						;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Variable ClassVal0 is not in the PARMS= data set.
NOTE: The SAS System stopped processing this step because of errors.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I don't know which part caused the error. My guesses are:&lt;/P&gt;&lt;P&gt;1. variable too long and truncated like&amp;nbsp;sum_therapy_mins_90day?&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;CLASSVAR=CLASSVAL is not for the surveyphreg procedure. But i also tried option: full and level. None of them worked for my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion would be highly valued!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508717#M26097</guid>
      <dc:creator>Crystal_F</dc:creator>
      <dc:date>2018-10-30T14:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: problem with proc mianalyze after the proc surveyphreg was performed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508728#M26099</link>
      <description>&lt;P&gt;The issue, as you might have guessed, is that SURVEYPHREG does not really create a data set compatible with any of the CLASSVAR= options.&amp;nbsp; It takes some modification of the ParameterEstimates data set.&amp;nbsp; Specifically, in order for PROC MIANALYZE to use this table it is necessary to modify the PARAMETER variable such&amp;nbsp;that its value in each row is a valid SAS name.&lt;/P&gt;
&lt;P&gt;The following DATA step uses the SCAN function to&amp;nbsp;pick out the first level (second word) in the PARAMETER variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data parms_class; &lt;BR /&gt;set gentemp.surveyphregest;&lt;/P&gt;
&lt;P&gt;grp = scan(parameter,2,' ');&lt;BR /&gt;if grp='' then effect=parameter;&lt;BR /&gt;else effect = 'grp';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc mianalyze parms(classvar=full)=parms_class edf=42;...&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508728#M26099</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2018-10-30T14:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem with proc mianalyze after the proc surveyphreg was performed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508784#M26101</link>
      <description>&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help. I changed the code as suggested:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data gentemp.parms_class; 
set gentemp.surveyphregest;
grp = scan(parameter,2,' ');
if grp='' then effect=parameter;
else effect = 'grp';
run;

proc mianalyze parms (CLASSVAR=full)=gentemp.parms_class edf=42;
	class race_f  gender_f 
      	  flag_rehospNONsk flag_rehospSk ICH
          type_fstrehab
          f_base_CollegeandAbove  f_base_married 
          f_base_insurance f_base_meanImputedIncomeCat 
          HEbeforeSKIPindex ;
	modeleffects        race_f gender_f age_skIPindex 
                        /*var from the initial ip clm */
                        flag_rehospNONsk flag_rehospSk ICH 
                        complicationIndex_IP ProcedureIndex_IP LOS_InitialIP 
						/*var from the first rehab*/
						type_fstrehab LOS_fstrehab 
                        complicationIndex_fstrehab 
						/*var from the transition dataset*/
						transition_number
						/*var from the thearpy estimates, only 90-day agg is needed*/  
						sum_therapy_mins_90day
                        /*var from the beneficiary cc file*/
						comorbidityIndex
						/*nhats baseline vars*/
                        f_base_CollegeandAbove  f_base_married  f_base_insurance f_base_meanImputedIncomeCat f_base_networkcount HEbeforeSKIPindex 
						;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is an error message:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Variable race_f is not in the PARMS= data set.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the&amp;nbsp;gentemp.parms_class dataset, the value of the variable grp is "Black", the value of the variable effect is 'grp'. I wonder if there is any solution to the new problem. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 16:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508784#M26101</guid>
      <dc:creator>Crystal_F</dc:creator>
      <dc:date>2018-10-30T16:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: problem with proc mianalyze after the proc surveyphreg was performed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508792#M26102</link>
      <description>&lt;P&gt;Sorry for the confusion.&amp;nbsp; I think the variable name was wrong in my code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this instead:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; gentemp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;parms_class&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; gentemp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;surveyphregest&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
race_f &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;scan&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;parameter&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; race_f&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;''&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; effect&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;parameter&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; effect &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'race_f'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;mianalyze&lt;/SPAN&gt; parms &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;CLASSVAR&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;full&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;gentemp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;parms_class edf&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;42&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt; race_f;&lt;BR /&gt;modeleffects race_f;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this works then you will need to do something similar for each of the CLASS variables.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 16:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/508792#M26102</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2018-10-30T16:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: problem with proc mianalyze after the proc surveyphreg was performed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/509565#M26124</link>
      <description>&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for making extra efforts on clarification. But I'm lost in building the right data structure for SAS to read in the imputation estimates. I tried your code and it did provide me the result without an error. But I'm not sure if i got this right. It turned out all the parameter was called 'race_f'. I wonder which variable is crucial for SAS to generate the result from proc mianalyze,&amp;nbsp;Am I trying to recreate a variable and keep its categorical value from the parameter column? And for the continuous variable .... Sorry, I was confused.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 15:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/problem-with-proc-mianalyze-after-the-proc-surveyphreg-was/m-p/509565#M26124</guid>
      <dc:creator>Crystal_F</dc:creator>
      <dc:date>2018-11-01T15:28:27Z</dc:date>
    </item>
  </channel>
</rss>

