<?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 Adding more explanatory variables stops predictions being generated in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/582660#M165774</link>
    <description>&lt;P&gt;Hello SAS experts&lt;/P&gt;&lt;P&gt;I'm using PROC HPGENSELECT&amp;nbsp;to model heavily zero-inflated health insurance "out of pocket"(OOP) costs to health plan members. I'm puzzled why I can generate predictions with 5 explanatory variables but not seven. I just get blanks in the predicted column using the second code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc hpgenselect data = OOP_logistic_CD technique=congra maxiter=1000 gconv=1e-4;
class sex(ref=first) ageGroup5yr(ref=last) char_prov(ref="Mersey-Lyell (TAS)") hospGroup(ref="Melbourne Endoscopy Group Pty Ltd") specialtyName(ref="Psychiatry")/param=ref; 
model memberOop= sex ageGroup5yr char_prov hospGroup specialtyName/dist=Tweedie link=log;
code File='scoringparameters.txt';
run;

data ScoringData;
informat sex $1. ageGroup5yr $5. hospGroup $60. specialtyName $60. char_prov $60.;
input sex= ageGroup5yr= hospGroup= specialtyName= char_prov=;
datalines;
sex=F ageGroup5yr=45-49 hospGroup=Ramsay Health Care specialtyName=ENT char_prov=Inner Sydney (NSW)
run; 
 data Scores;
 set ScoringData;
 %include 'scoringparameters.txt';
proc print data=Scores;
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the code using 7 predictors which just gives the blanks in the "Scores" dataset:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc hpgenselect data = OOP_logistic_CD technique=congra maxiter=1000 gconv=1e-4;
class itemCatLev1Med(ref=last) sex(ref=first) ageGroup5yr(ref=last) char_prov(ref="Mersey-Lyell (TAS)") hospGroup(ref="Melbourne Endoscopy Group Pty Ltd") hospType(ref="Public" ) specialtyName(ref="Psychiatry")/param=ref; 
model memberOop= itemCatLev1Med sex ageGroup5yr char_prov hospGroup hospType specialtyName/dist=Tweedie link=log;
code File='scoringparameters.txt';
run;
data ScoringData;
informat itemCatLev1Med $40. sex $1. ageGroup5yr $5. char_prov $60. hospGroup $60. hospType $40. specialtyName $60.;
input itemCatLev1Med= sex= ageGroup5yr= char_prov= hospGroup=  hospType= specialtyName=;
datalines;
itemCatLev1Med=Surgical Operations sex=F ageGroup5yr=45-49 hospGroup=Ramsay Health Care hospType=Private specialtyName=ENT char_prov=Inner Sydney (NSW)
run;
data Scores;
 set ScoringData;
%include 'scoringparameters.txt'; 
proc print data=Scores;
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I suspect this is due to some collinearity although it doesn't seem that this should occur.&lt;/P&gt;&lt;P&gt;Thanks for any advice.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2019 04:52:22 GMT</pubDate>
    <dc:creator>daltonchris7720</dc:creator>
    <dc:date>2019-08-21T04:52:22Z</dc:date>
    <item>
      <title>Adding more explanatory variables stops predictions being generated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/582660#M165774</link>
      <description>&lt;P&gt;Hello SAS experts&lt;/P&gt;&lt;P&gt;I'm using PROC HPGENSELECT&amp;nbsp;to model heavily zero-inflated health insurance "out of pocket"(OOP) costs to health plan members. I'm puzzled why I can generate predictions with 5 explanatory variables but not seven. I just get blanks in the predicted column using the second code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc hpgenselect data = OOP_logistic_CD technique=congra maxiter=1000 gconv=1e-4;
class sex(ref=first) ageGroup5yr(ref=last) char_prov(ref="Mersey-Lyell (TAS)") hospGroup(ref="Melbourne Endoscopy Group Pty Ltd") specialtyName(ref="Psychiatry")/param=ref; 
model memberOop= sex ageGroup5yr char_prov hospGroup specialtyName/dist=Tweedie link=log;
code File='scoringparameters.txt';
run;

data ScoringData;
informat sex $1. ageGroup5yr $5. hospGroup $60. specialtyName $60. char_prov $60.;
input sex= ageGroup5yr= hospGroup= specialtyName= char_prov=;
datalines;
sex=F ageGroup5yr=45-49 hospGroup=Ramsay Health Care specialtyName=ENT char_prov=Inner Sydney (NSW)
run; 
 data Scores;
 set ScoringData;
 %include 'scoringparameters.txt';
proc print data=Scores;
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the code using 7 predictors which just gives the blanks in the "Scores" dataset:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc hpgenselect data = OOP_logistic_CD technique=congra maxiter=1000 gconv=1e-4;
class itemCatLev1Med(ref=last) sex(ref=first) ageGroup5yr(ref=last) char_prov(ref="Mersey-Lyell (TAS)") hospGroup(ref="Melbourne Endoscopy Group Pty Ltd") hospType(ref="Public" ) specialtyName(ref="Psychiatry")/param=ref; 
model memberOop= itemCatLev1Med sex ageGroup5yr char_prov hospGroup hospType specialtyName/dist=Tweedie link=log;
code File='scoringparameters.txt';
run;
data ScoringData;
informat itemCatLev1Med $40. sex $1. ageGroup5yr $5. char_prov $60. hospGroup $60. hospType $40. specialtyName $60.;
input itemCatLev1Med= sex= ageGroup5yr= char_prov= hospGroup=  hospType= specialtyName=;
datalines;
itemCatLev1Med=Surgical Operations sex=F ageGroup5yr=45-49 hospGroup=Ramsay Health Care hospType=Private specialtyName=ENT char_prov=Inner Sydney (NSW)
run;
data Scores;
 set ScoringData;
%include 'scoringparameters.txt'; 
proc print data=Scores;
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I suspect this is due to some collinearity although it doesn't seem that this should occur.&lt;/P&gt;&lt;P&gt;Thanks for any advice.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 04:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/582660#M165774</guid>
      <dc:creator>daltonchris7720</dc:creator>
      <dc:date>2019-08-21T04:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding more explanatory variables stops predictions being generated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/582692#M165792</link>
      <description>&lt;P&gt;I think this may be due to missing observations in HospType; if I dropped this one the predictions worked ok.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 07:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/582692#M165792</guid>
      <dc:creator>daltonchris7720</dc:creator>
      <dc:date>2019-08-21T07:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding more explanatory variables stops predictions being generated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/582846#M165851</link>
      <description>&lt;P&gt;Does the log show anything different for the 7 variable model vs the 5 variable model?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have missing values for your variables on the model statement such that each record has at least one missing then there isn't any data left to build the model.&lt;/P&gt;
&lt;P&gt;From the documentation :&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Any observation that has missing values for the response, frequency, weight, offset, or explanatory variables is excluded from the analysis; however, missing values are valid for response and explanatory variables that are specified in the MISSING option in the &lt;A href="http://127.0.0.1:59424/help/stathpug.hlp/stathpug_hpgenselect_syntax03.htm" target="_blank"&gt;CLASS&lt;/A&gt; statement.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 15:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/582846#M165851</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-21T15:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Adding more explanatory variables stops predictions being generated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/583381#M166069</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I couldn't spot anything in the log for the model construction or the predictions construction in a 5,6 or 7 predictor model; it just gives blanks for the predicted Out of pocket expense with HospType(Private,Public,Daystay,Closed) in the model, although the hospType estimators are sensible.&lt;/P&gt;&lt;P&gt;However the predictions work if I drop HospType. It's a shame there are so many missing values. This observation value&amp;nbsp;is easy to discern/record so I'm not sure why there are&amp;nbsp;so many missing.&amp;nbsp;There are 5.5 million observations in the dataset so too many to go through and correct it! I could impute the missing values&amp;nbsp;as all Private I guess(most of them would be) but this would not be entirely accurate.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 02:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-more-explanatory-variables-stops-predictions-being/m-p/583381#M166069</guid>
      <dc:creator>daltonchris7720</dc:creator>
      <dc:date>2019-08-23T02:02:42Z</dc:date>
    </item>
  </channel>
</rss>

