<?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 write a code for multiple linear regression looking at predictors sex, age, weight for an out in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-a-code-for-multiple-linear-regression-looking-at/m-p/883871#M43764</link>
    <description>&lt;P&gt;I am very new to stats and have only taken one course so far (which did not cover this) so I am a little out of my wheelhouse. Thank you in advance for any help you can give.&lt;/P&gt;&lt;P&gt;I am working in SAS and am trying to figure out how to write a code where I can determine which, if any, of these predictors affect my outcome "value".&lt;/P&gt;&lt;P&gt;Details on my data: 4 groups basically, young female adults, senior female adults, young male adults, senior male adults. I have recorded a value for each group, but want to analyse this data continously rather than by group since each group ranges in age values. So far my data (and code that I have tried, and failed) looks something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/*Test Data*/
Data;
input Sex$ Age Value;
cards;
M	13	1
M	3	0.5
F	2	0.6
M	3	0.5
M	3	0.5
M	3	0.5
F	1	0.6
F	11	1.2
F	2	0.6
M	3	0.5
M	13	1
F	2	0.6
F	3	0.6
F	3	0.6
M	9	1
M	1	0.5
M	9	1
M	9	1
F	13	1.2
M	11	1
F	11	1.2
M	11	1
M	3	0.5
F	3	0.6
M	3	0.5
M	1	0.5
M	16	1
M	11	1
M	3	0.5
M	1	0.5
M	2	0.5
F	9	1.2
F	9	1.2
M	3	0.5
F	2	0.6
F	12	1.2
F	9	1.2


;
run;
proc reg;
model Value= Age Sex;
run;
proc reg;
model Value= Age;
run;
proc reg;
model Value= Sex;
run;
Proc reg;
model Value= Age Sex / selection= stepwise slentry=0.05;
run;
proc corr;
var Sex Age Value;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I haven't even managed to put the weight predictor in there because I'm not sure how to add it. My code also does not like Sex being there.&lt;/P&gt;&lt;P&gt;I really just need to figure out if age, sex, or weight will affect my "value". Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 00:13:53 GMT</pubDate>
    <dc:creator>kplbug8</dc:creator>
    <dc:date>2023-07-07T00:13:53Z</dc:date>
    <item>
      <title>How to write a code for multiple linear regression looking at predictors sex, age, weight for an out</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-a-code-for-multiple-linear-regression-looking-at/m-p/883871#M43764</link>
      <description>&lt;P&gt;I am very new to stats and have only taken one course so far (which did not cover this) so I am a little out of my wheelhouse. Thank you in advance for any help you can give.&lt;/P&gt;&lt;P&gt;I am working in SAS and am trying to figure out how to write a code where I can determine which, if any, of these predictors affect my outcome "value".&lt;/P&gt;&lt;P&gt;Details on my data: 4 groups basically, young female adults, senior female adults, young male adults, senior male adults. I have recorded a value for each group, but want to analyse this data continously rather than by group since each group ranges in age values. So far my data (and code that I have tried, and failed) looks something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/*Test Data*/
Data;
input Sex$ Age Value;
cards;
M	13	1
M	3	0.5
F	2	0.6
M	3	0.5
M	3	0.5
M	3	0.5
F	1	0.6
F	11	1.2
F	2	0.6
M	3	0.5
M	13	1
F	2	0.6
F	3	0.6
F	3	0.6
M	9	1
M	1	0.5
M	9	1
M	9	1
F	13	1.2
M	11	1
F	11	1.2
M	11	1
M	3	0.5
F	3	0.6
M	3	0.5
M	1	0.5
M	16	1
M	11	1
M	3	0.5
M	1	0.5
M	2	0.5
F	9	1.2
F	9	1.2
M	3	0.5
F	2	0.6
F	12	1.2
F	9	1.2


;
run;
proc reg;
model Value= Age Sex;
run;
proc reg;
model Value= Age;
run;
proc reg;
model Value= Sex;
run;
Proc reg;
model Value= Age Sex / selection= stepwise slentry=0.05;
run;
proc corr;
var Sex Age Value;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I haven't even managed to put the weight predictor in there because I'm not sure how to add it. My code also does not like Sex being there.&lt;/P&gt;&lt;P&gt;I really just need to figure out if age, sex, or weight will affect my "value". Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 00:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-a-code-for-multiple-linear-regression-looking-at/m-p/883871#M43764</guid>
      <dc:creator>kplbug8</dc:creator>
      <dc:date>2023-07-07T00:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a code for multiple linear regression looking at predictors sex, age, weight for an</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-a-code-for-multiple-linear-regression-looking-at/m-p/883952#M43770</link>
      <description>&lt;P&gt;SEX is a CLASS variable so you either need to create a dummy variable for SEX and use that dummy variable in PROC REG, or use PROC GLM and a CLASS statement. For example,&lt;/P&gt;
&lt;P&gt;proc glm data=&amp;lt;yourdatasetname&amp;gt;;&lt;/P&gt;
&lt;P&gt;class sex;&lt;/P&gt;
&lt;P&gt;model value = sex age / solution;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data yourdata;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set yourdata;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Male=(sex='M');&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;proc reg data=yourdata;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;model value=male age;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jill&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 13:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-a-code-for-multiple-linear-regression-looking-at/m-p/883952#M43770</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2023-07-07T13:32:10Z</dc:date>
    </item>
  </channel>
</rss>

