<?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: Correct code for fixed effects methods? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865815#M42802</link>
    <description>There is no need to put variables in the CLASS statement that are not also specified in the MODEL statement, and as mentioned, doing so can result in additional observations being ignored if the extra variables contain missing values. But if the extra variables contain no missings, then the results should be the same with or without them in the CLASS statement. You should never put continuous variables in the CLASS statement unless you want to treat them as categorical and they have relatively few values. Any variable in the CLASS statement is treated as categorical by internally creating a set of variables that are used in the design/model matrix to represent that variable.&lt;BR /&gt;&lt;BR /&gt;If your continuous, 3 month averaged variables for a subject are the result of averaging the separate values from each of the observations for that subject, then you are just throwing away information. You might better use the separate values in each of the three observations for each subject.</description>
    <pubDate>Wed, 22 Mar 2023 22:56:08 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2023-03-22T22:56:08Z</dc:date>
    <item>
      <title>Correct code for fixed effects methods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865205#M42782</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am using fixed effects with logistic regression for three observations per person. In my data there are three rows for each person. I have two questions.&lt;/P&gt;
&lt;P&gt;My first question is if my code below is correct? Outcome is dichotomized with 0 as a reference and exposure is three months averaged continuous variable. Covariates are age in 11 categories, ses is socioeconomic status in three categories, married is dichotomized, humid_3mon is three month averaged humidity as continuous variable and so is temp_3mon (temperature) . I have not added continuous variables in the CLASS statement as it takes forever to run the code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data= analysis;
class  ses(ref='1') married(ref='1')/ param=ref;
model outcome(ref='0') = exposure age ses married temp_3mon humid_3mon/ expb;
strata id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My second question is, if I am adding confounders at different steps (step 1, only ses as a covariate, and in step 1, ses + married as covariates) do I need to list both covariates in the CLASS statement from step 1? I have given a syntax for both steps to show what I am trying to ask.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 1,&lt;/STRONG&gt; I want to add only ses as a covariate in MODEL along with age and weather parameters. But I have listed married in the CLASS statement which I will test in step 2.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data= analysis;
class  ses(ref='1') married(ref='1')/ param=ref;
model outcome(ref='0') = exposure age ses temp_3mon humid_3mon/ expb;
strata id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Step 2,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data= analysis;
class  ses(ref='1') married(ref='1')/ param=ref;
model outcome(ref='0') = exposure age ses married temp_3mon humid_3mon/ expb;
strata id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Mar 2023 13:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865205#M42782</guid>
      <dc:creator>Raza_M</dc:creator>
      <dc:date>2023-03-20T13:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Correct code for fixed effects methods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865422#M42791</link>
      <description>The answer may depend, in part, on whether there are any covariates with missing values in your data set. For when you add a variable to the CLASS statement, SAS uses that information to parameterize the model. So, for example, if any values of 'married' are missing, the observations with missing values will be dropped from the analysis in Step 1 even though 'married' is not a covariate. Personally, I only put the variables I'm using in the class statement to avoid listwise deletion that I'm not planning to see.</description>
      <pubDate>Tue, 21 Mar 2023 13:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865422#M42791</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2023-03-21T13:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Correct code for fixed effects methods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865671#M42796</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank for the reply!&lt;/P&gt;
&lt;P&gt;I have several covariates and have missing values. In my actual model, I didn't list them all in the CLASS statement from the first step. I have added them in the CLASS statement in a model where I am controlling for them. My thinking behind was, some of the covariates added in the last steps might not be a strong confounder but due to missing values these might limit the power if I put them in the CLASS statement from the beginning. But then I got a comment that, sample population is different at each step when all the covariates are not listed in the CLASS statement in the first step.&lt;/P&gt;
&lt;P&gt;In my results, I clearly see that at each step when I add covariates risk estimate doesn't change much but in the last step confidence intervals became wider.&lt;/P&gt;
&lt;P&gt;I just want to be sure if what I am doing is correct.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 08:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865671#M42796</guid>
      <dc:creator>Raza_M</dc:creator>
      <dc:date>2023-03-22T08:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Correct code for fixed effects methods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865815#M42802</link>
      <description>There is no need to put variables in the CLASS statement that are not also specified in the MODEL statement, and as mentioned, doing so can result in additional observations being ignored if the extra variables contain missing values. But if the extra variables contain no missings, then the results should be the same with or without them in the CLASS statement. You should never put continuous variables in the CLASS statement unless you want to treat them as categorical and they have relatively few values. Any variable in the CLASS statement is treated as categorical by internally creating a set of variables that are used in the design/model matrix to represent that variable.&lt;BR /&gt;&lt;BR /&gt;If your continuous, 3 month averaged variables for a subject are the result of averaging the separate values from each of the observations for that subject, then you are just throwing away information. You might better use the separate values in each of the three observations for each subject.</description>
      <pubDate>Wed, 22 Mar 2023 22:56:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Correct-code-for-fixed-effects-methods/m-p/865815#M42802</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-03-22T22:56:08Z</dc:date>
    </item>
  </channel>
</rss>

