<?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: How do I interpret a log transformed dependent variable in proc GLM with categorical predictors? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742443#M36127</link>
    <description>&lt;P&gt;This is the code where the variables were created:&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;/P&gt;&lt;P&gt;LOG_Y = log(Y);&lt;/P&gt;&lt;P&gt;*creating var A*;&lt;BR /&gt;if doc &amp;lt;= '01JUN2019:00:00:00'dt then A = 0;&lt;BR /&gt;else if doc =&amp;gt; '01JUN2019:00:00:00'dt then A = 1;&lt;/P&gt;&lt;P&gt;*creating var B*;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if time &amp;gt;= '07:00:00't and time &amp;lt;= '18:59:59't then B = 0;&lt;BR /&gt;else B = 1;&lt;/P&gt;&lt;P&gt;*creating var TEAM*;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if team___1 = 1 AND team___3 = 1 then TEAM = 0;&lt;BR /&gt;else TEAM = 1;&lt;BR /&gt;*error: already existed from database, 0 = no, 1 = yes*;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rename com_group___5 = error;&lt;/P&gt;&lt;P&gt;*creating var age_group*;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if age &amp;lt; 730 then age_group = 0;&lt;BR /&gt;else if age &amp;gt;= 730 and age &amp;lt; 4380 then age_group = 1;&lt;BR /&gt;else if age &amp;gt;= 4380 and age &amp;lt;= 6570 then age_group = 2; &amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code for GLM, which gave the results previously posted :&lt;/P&gt;&lt;P&gt;proc glm data=want;&lt;BR /&gt;class A (ref="0") error (ref="0") TEAM (ref = "0");&lt;BR /&gt;model LOG_Y = A TEAM error / solution clparm;&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code with 3 levels of category (age_group) and interaction:&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glm data=want;&lt;BR /&gt;class A(ref="0") error(ref="0") B(ref = "0") age_group(ref = "0");&lt;BR /&gt;model LOG_Y = A error age_group A*B/ solution clparm;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 May 2021 15:28:16 GMT</pubDate>
    <dc:creator>epibio2021</dc:creator>
    <dc:date>2021-05-19T15:28:16Z</dc:date>
    <item>
      <title>How do I interpret a log transformed dependent variable in proc GLM with categorical predictors?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742320#M36121</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a continuous outcome and multiple categorical/binary predictors (coded as dummy variables 0 and 1), so I used a multiple linear regression. I had to log transform the outcome variable to fit linear model assumptions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I go about interpreting each predictor?&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Parameter Estimate &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Intercept&amp;nbsp; &amp;nbsp;&amp;nbsp;3.64&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;A 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.48&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;A 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;TEAM 1&amp;nbsp; &amp;nbsp; &amp;nbsp;0.49&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;TEAM 0&amp;nbsp; &amp;nbsp; &amp;nbsp;0.00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;error 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.55&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;error 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.00&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;For TP, it would be (e^0.49)-1*100% = 0.63. Would my interpretation be:&lt;/P&gt;&lt;P&gt;a) For every unit increase in A, there is a 63% increase in Y, while team is 0 and error is 0 (holding all other variables constant).&amp;nbsp;&lt;/P&gt;&lt;P&gt;b) There is a 63% increase in Y for A 0 compared to A 1, while team is 0 and error is 0 (holding all other variables constant.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because this predictor is binary, I don't know if if "for every unit increase" is appropriate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would the interpretation be the same for the other predictors?&amp;nbsp;&lt;/P&gt;&lt;P&gt;For TEAM,&amp;nbsp;(e^0.49)-1*100% = 0.62.&amp;nbsp;&lt;/P&gt;&lt;P&gt;a) For every unit increase in TEAM, there is a 62% increase in Y, while A is 0 and error is 0 (holding all other variables constant).&amp;nbsp;&lt;/P&gt;&lt;P&gt;b) There is a 63% increase in Y for TEAM 0 compared to TEAM 1, while team is 0 and error is 0 (holding all other variables constant.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would the interpretation be if the categorical predictor had 3 levels (0, 1, 2)? Or if there was an interaction in the predictors TEAM*A?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 04:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742320#M36121</guid>
      <dc:creator>epibio2021</dc:creator>
      <dc:date>2021-05-19T04:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I interpret a log transformed dependent variable in proc GLM with categorical predictors?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742433#M36126</link>
      <description>&lt;P&gt;It helps to start by showing the SAS code used with GLM. That will give us some chance of answering the question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The behavior can change somewhat depending on if you actually created a slew of dummy variables or used the CLASS statement on GLM and how you did the "Log transform".&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 15:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742433#M36126</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-19T15:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I interpret a log transformed dependent variable in proc GLM with categorical predictors?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742443#M36127</link>
      <description>&lt;P&gt;This is the code where the variables were created:&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;/P&gt;&lt;P&gt;LOG_Y = log(Y);&lt;/P&gt;&lt;P&gt;*creating var A*;&lt;BR /&gt;if doc &amp;lt;= '01JUN2019:00:00:00'dt then A = 0;&lt;BR /&gt;else if doc =&amp;gt; '01JUN2019:00:00:00'dt then A = 1;&lt;/P&gt;&lt;P&gt;*creating var B*;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if time &amp;gt;= '07:00:00't and time &amp;lt;= '18:59:59't then B = 0;&lt;BR /&gt;else B = 1;&lt;/P&gt;&lt;P&gt;*creating var TEAM*;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if team___1 = 1 AND team___3 = 1 then TEAM = 0;&lt;BR /&gt;else TEAM = 1;&lt;BR /&gt;*error: already existed from database, 0 = no, 1 = yes*;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rename com_group___5 = error;&lt;/P&gt;&lt;P&gt;*creating var age_group*;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if age &amp;lt; 730 then age_group = 0;&lt;BR /&gt;else if age &amp;gt;= 730 and age &amp;lt; 4380 then age_group = 1;&lt;BR /&gt;else if age &amp;gt;= 4380 and age &amp;lt;= 6570 then age_group = 2; &amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code for GLM, which gave the results previously posted :&lt;/P&gt;&lt;P&gt;proc glm data=want;&lt;BR /&gt;class A (ref="0") error (ref="0") TEAM (ref = "0");&lt;BR /&gt;model LOG_Y = A TEAM error / solution clparm;&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code with 3 levels of category (age_group) and interaction:&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glm data=want;&lt;BR /&gt;class A(ref="0") error(ref="0") B(ref = "0") age_group(ref = "0");&lt;BR /&gt;model LOG_Y = A error age_group A*B/ solution clparm;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 15:28:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742443#M36127</guid>
      <dc:creator>epibio2021</dc:creator>
      <dc:date>2021-05-19T15:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I interpret a log transformed dependent variable in proc GLM with categorical predictors?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742452#M36128</link>
      <description>&lt;P&gt;Transforming the response variable (to achieve normality of errors?) isn't necessary for fitting a model and estimating an effect of a categorical variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is necessary to perform hypothesis tests and creating confidence intervals.&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 15:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742452#M36128</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-19T15:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I interpret a log transformed dependent variable in proc GLM with categorical predictors?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742483#M36139</link>
      <description>I have conducted t-tests for all my categorical predictors (which were originally continuous variables) on the outcome. After finding significant predictors for my outcome, I need a model that accounts for my predictors to find the association between the predictors and the outcome. What would you suggest other than a multiple linear regression?&lt;BR /&gt;</description>
      <pubDate>Wed, 19 May 2021 18:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742483#M36139</guid>
      <dc:creator>epibio2021</dc:creator>
      <dc:date>2021-05-19T18:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I interpret a log transformed dependent variable in proc GLM with categorical predictors?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742498#M36141</link>
      <description>&lt;P&gt;For the first model you showed (a main effects only model), the exponentiated parameter estimate for any predictor is an estimate of the ratio of Y means comparing the associated level to the predictor's reference level.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example: (mean(Y)&amp;nbsp; for TEAM 1)/(mean(Y) for TEAM 0) = exp(0.49) .&amp;nbsp; Expressed as a percent change: (exp(0.49)-1)*100%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly for A and ERROR. It is the same for a multilevel CLASS predictor - still a comparison of the level that the parameter estimate is associated with vs the reference level. For a continuous predictor, it is the ratio for a unit change in the predictor. Notice that it is a ratio, not a difference, of means since you log-transformed your response, presumably because you are assuming that Y is log-normally distributed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 19:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-interpret-a-log-transformed-dependent-variable-in-proc/m-p/742498#M36141</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-05-19T19:20:18Z</dc:date>
    </item>
  </channel>
</rss>

