<?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 How to Find the Optimal Level of a Predictor Variable in Proc PHREG in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-Find-the-Optimal-Level-of-a-Predictor-Variable-in-Proc/m-p/729655#M35372</link>
    <description>&lt;P&gt;Hello, I have a dataset that contains the levels of a dietary nutrient for different individuals as well as their cancer outcome and length of follow up/censoring time. I have initially divided up up the nutrient data into quintiles to compare each group's cancer outcomes like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc phreg data = nutrient_dataset;
&lt;BR /&gt;class nutrient_quintile (ref="0") other_categorical_predictor;
model Age_at_EndFollowUp*Cancer_outcome(0) = nutrient_quintile 
other_categorical_predictor other_continuous_predictor
		/ entry=Age_at_Enrollment rl=wald;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Where the predictor/independent variable of interest is nutrient_quintile and other predictors/potential confounders are: other_categorical_predictor and other_continuous_predictor. In reality, there are multiple continuous predictors, but I'm keeping it simple for the post. While analyzing the hazard ratios of the resulting data, it appears that there is a threshold effect for some of the nutrients. What I mean is that instead of seeing each quintile having fewer and fewer cases of cancer, the data shows that once you reach a certain quintile/nutrient level the the risk of cancer stays at about the same lower level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: Quintile 1 Hazard ratio = 1. Quintile 2 Hazard ratio = 1. Quintile 3 Hazard ratio = 0.8. Quintile 4 Hazard ratio = 0.8. Quintile 5 Hazard ratio = 0.8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This means that once individuals reach a certain level of the nutrient, their risk stays at about the same lower level. I am still very new to SAS, but I wanted to see if there was a function, proc, or macro that could be used to find the optimal threshold for this nutrient. The continuous variable would be: nutrient_level. It would somehow identify the nutrient level at which individuals above that level have the lower risk. In the example above, the question would be at what nutrient_level does the risk transition from 1 to 0.8?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;I know I could guess levels and split the individuals above and below that level until I found the best number, but I know this would take a long time and wanted to see if there were better options.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Mar 2021 18:55:44 GMT</pubDate>
    <dc:creator>fikel</dc:creator>
    <dc:date>2021-03-28T18:55:44Z</dc:date>
    <item>
      <title>How to Find the Optimal Level of a Predictor Variable in Proc PHREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-Find-the-Optimal-Level-of-a-Predictor-Variable-in-Proc/m-p/729655#M35372</link>
      <description>&lt;P&gt;Hello, I have a dataset that contains the levels of a dietary nutrient for different individuals as well as their cancer outcome and length of follow up/censoring time. I have initially divided up up the nutrient data into quintiles to compare each group's cancer outcomes like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc phreg data = nutrient_dataset;
&lt;BR /&gt;class nutrient_quintile (ref="0") other_categorical_predictor;
model Age_at_EndFollowUp*Cancer_outcome(0) = nutrient_quintile 
other_categorical_predictor other_continuous_predictor
		/ entry=Age_at_Enrollment rl=wald;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Where the predictor/independent variable of interest is nutrient_quintile and other predictors/potential confounders are: other_categorical_predictor and other_continuous_predictor. In reality, there are multiple continuous predictors, but I'm keeping it simple for the post. While analyzing the hazard ratios of the resulting data, it appears that there is a threshold effect for some of the nutrients. What I mean is that instead of seeing each quintile having fewer and fewer cases of cancer, the data shows that once you reach a certain quintile/nutrient level the the risk of cancer stays at about the same lower level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: Quintile 1 Hazard ratio = 1. Quintile 2 Hazard ratio = 1. Quintile 3 Hazard ratio = 0.8. Quintile 4 Hazard ratio = 0.8. Quintile 5 Hazard ratio = 0.8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This means that once individuals reach a certain level of the nutrient, their risk stays at about the same lower level. I am still very new to SAS, but I wanted to see if there was a function, proc, or macro that could be used to find the optimal threshold for this nutrient. The continuous variable would be: nutrient_level. It would somehow identify the nutrient level at which individuals above that level have the lower risk. In the example above, the question would be at what nutrient_level does the risk transition from 1 to 0.8?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;I know I could guess levels and split the individuals above and below that level until I found the best number, but I know this would take a long time and wanted to see if there were better options.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Mar 2021 18:55:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-Find-the-Optimal-Level-of-a-Predictor-Variable-in-Proc/m-p/729655#M35372</guid>
      <dc:creator>fikel</dc:creator>
      <dc:date>2021-03-28T18:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to Find the Optimal Level of a Predictor Variable in Proc PHREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-Find-the-Optimal-Level-of-a-Predictor-Variable-in-Proc/m-p/729773#M35380</link>
      <description>&lt;P&gt;Spoiler alert: This method has not been tried on real data, and might not quite be what you are looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can do this using PROC NLMIXED.&amp;nbsp; Check the example in the documentation here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_nlmixed_examples05.htm&amp;amp;locale=en" target="_self"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_nlmixed_examples05.htm&amp;amp;locale=en&lt;/A&gt;&amp;nbsp; for fitting a failure time/frailty model.&amp;nbsp; What you would have to do is incorporate a segmented model using nutrient level as a continuous variable.&amp;nbsp; Code to get started is in the NLIN example here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_nlin_examples01.htm&amp;amp;locale=en" target="_self"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_nlin_examples01.htm&amp;amp;locale=en&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, Mr. Google is your friend.&amp;nbsp; I got several results on a search for "failure time" and "nlmixed", so there should be something out there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 13:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-Find-the-Optimal-Level-of-a-Predictor-Variable-in-Proc/m-p/729773#M35380</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-03-29T13:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to Find the Optimal Level of a Predictor Variable in Proc PHREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-Find-the-Optimal-Level-of-a-Predictor-Variable-in-Proc/m-p/730069#M35403</link>
      <description>&lt;P&gt;To build on Steve's suggestion, look at the article &lt;A href="https://blogs.sas.com/content/iml/2020/12/14/segmented-regression-sas.html" target="_self"&gt;"Segmented regression models in SAS,"&lt;/A&gt; which shows how to use PROC NLIN to build a segmented regression model. You want to estimate the "cutoff point" at which the response variable reaches a plateau. The article provides data and SAS code.&amp;nbsp; Notice that you need to use the continuous explanatory variable rather than a binned version of it.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 12:36:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-Find-the-Optimal-Level-of-a-Predictor-Variable-in-Proc/m-p/730069#M35403</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-03-30T12:36:40Z</dc:date>
    </item>
  </channel>
</rss>

