<?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: LASSO Cox proportional hazards model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/LASSO-Cox-proportional-hazards-model/m-p/331679#M17519</link>
    <description>&lt;P&gt;I have the same need, but came to the conclusion that it is not in SAS (yet).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is possible to run a cox-regression in Proc HPGENSELECT, but it may not work very good: You need to make a aggregated dataset such information on each risk set is collected in the same records (one record for each different combination of covariates and riskset). Then a poisson regression model where with&amp;nbsp;the time-variable included&amp;nbsp;as a class variable and log(number at risk) as offset variable&amp;nbsp;is equivalent to a cox-regression.&amp;nbsp;There is at least to drawback for this method: 1) there can be overwhelming many parameters because each riskset add one parameter to the model, and 2) the time variable that is included in the model statement can give some trouble with the LASSO method (time has to be included and is not allowed to leave the model). If you want to try, you can use the cox-aggregate macro I attached to this article &lt;A title="Cox-aggreate" href="https://communities.sas.com/t5/SAS-Communities-Library/A-method-to-speed-up-PROC-PHREG-when-doing-a-Cox-regression/ta-p/223571" target="_self"&gt;Cox-aggreate&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and an example of how to estimate&amp;nbsp;parameters&amp;nbsp;in a&amp;nbsp;cox-regression with HPGENSELECT:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data simulation;
  array covariate{10};
  entry=0;
  event=1;
  do i=1 to 1000;
    do k=1 to 10;
      covariate[k]=rand('bernoulli',0.5);
    end;
    rate=exp(-0.5*covariate2-0.1*covariate4+0.1*covariate5+0.8*covariate6);
    t=rand('exponential',1/rate);
    output;
  end;
run;
%coxaggregate(data=simulation,output=dataout,entry=entry,exit=t,event=event,covariate=covariate1+covariate2+covariate3+covariate4+covariate5+covariate6+covariate7+covariate8+covariate9+covariate10,type=logistic);

*(aggregated data may be larger than original data);

data dataout;
  set dataout;
  log_atrisk=log(n);
run;
&lt;BR /&gt;*In this model you can make some variable selection. But always keep time in the model!;
proc hpgenselect data=dataout;
  class time;
  model d=covariate1-covariate10 time/dist=poisson link=log offset=log_atrisk;
run;

*equivalent to use phreg on non-aggreated data;
proc phreg data=simulation;
  model t=covariate1-covariate10;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 Feb 2017 20:50:57 GMT</pubDate>
    <dc:creator>JacobSimonsen</dc:creator>
    <dc:date>2017-02-10T20:50:57Z</dc:date>
    <item>
      <title>LASSO Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/LASSO-Cox-proportional-hazards-model/m-p/331620#M17516</link>
      <description>&lt;P&gt;I understand LASSO model selection can be applied to survival data (Cox proportional hazard models). Please see &lt;A href="https://www.ncbi.nlm.nih.gov/pubmed/9044528" target="_blank"&gt;https://www.ncbi.nlm.nih.gov/pubmed/9044528&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could anyone please suggest some SAS syntax for this? Anything in Proc HPGENSELECT? Thanks. &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/LASSO-Cox-proportional-hazards-model/m-p/331620#M17516</guid>
      <dc:creator>TJ87</dc:creator>
      <dc:date>2017-02-10T18:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: LASSO Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/LASSO-Cox-proportional-hazards-model/m-p/331679#M17519</link>
      <description>&lt;P&gt;I have the same need, but came to the conclusion that it is not in SAS (yet).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is possible to run a cox-regression in Proc HPGENSELECT, but it may not work very good: You need to make a aggregated dataset such information on each risk set is collected in the same records (one record for each different combination of covariates and riskset). Then a poisson regression model where with&amp;nbsp;the time-variable included&amp;nbsp;as a class variable and log(number at risk) as offset variable&amp;nbsp;is equivalent to a cox-regression.&amp;nbsp;There is at least to drawback for this method: 1) there can be overwhelming many parameters because each riskset add one parameter to the model, and 2) the time variable that is included in the model statement can give some trouble with the LASSO method (time has to be included and is not allowed to leave the model). If you want to try, you can use the cox-aggregate macro I attached to this article &lt;A title="Cox-aggreate" href="https://communities.sas.com/t5/SAS-Communities-Library/A-method-to-speed-up-PROC-PHREG-when-doing-a-Cox-regression/ta-p/223571" target="_self"&gt;Cox-aggreate&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and an example of how to estimate&amp;nbsp;parameters&amp;nbsp;in a&amp;nbsp;cox-regression with HPGENSELECT:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data simulation;
  array covariate{10};
  entry=0;
  event=1;
  do i=1 to 1000;
    do k=1 to 10;
      covariate[k]=rand('bernoulli',0.5);
    end;
    rate=exp(-0.5*covariate2-0.1*covariate4+0.1*covariate5+0.8*covariate6);
    t=rand('exponential',1/rate);
    output;
  end;
run;
%coxaggregate(data=simulation,output=dataout,entry=entry,exit=t,event=event,covariate=covariate1+covariate2+covariate3+covariate4+covariate5+covariate6+covariate7+covariate8+covariate9+covariate10,type=logistic);

*(aggregated data may be larger than original data);

data dataout;
  set dataout;
  log_atrisk=log(n);
run;
&lt;BR /&gt;*In this model you can make some variable selection. But always keep time in the model!;
proc hpgenselect data=dataout;
  class time;
  model d=covariate1-covariate10 time/dist=poisson link=log offset=log_atrisk;
run;

*equivalent to use phreg on non-aggreated data;
proc phreg data=simulation;
  model t=covariate1-covariate10;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Feb 2017 20:50:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/LASSO-Cox-proportional-hazards-model/m-p/331679#M17519</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2017-02-10T20:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: LASSO Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/LASSO-Cox-proportional-hazards-model/m-p/331686#M17520</link>
      <description>&lt;P&gt;Wow thanks I'll give this a try.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 20:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/LASSO-Cox-proportional-hazards-model/m-p/331686#M17520</guid>
      <dc:creator>TJ87</dc:creator>
      <dc:date>2017-02-10T20:59:41Z</dc:date>
    </item>
  </channel>
</rss>

