<?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: Risk factors combined variable in a multiple regression was not working in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914449#M40931</link>
    <description>That works! I was putting in variables and getting errors. Thanks.</description>
    <pubDate>Sun, 04 Feb 2024 23:24:43 GMT</pubDate>
    <dc:creator>dkcundiffMD</dc:creator>
    <dc:date>2024-02-04T23:24:43Z</dc:date>
    <item>
      <title>Risk factors combined variable in a multiple regression was not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/913911#M40918</link>
      <description>&lt;P&gt;&lt;EM&gt;SAS on Demand for Academics&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I partitioned a large analysis risk factor and health outcome database into a subset of interest. I standardized Dietary and other variables. And tried to proceed to a multiple regression with dietary variables in one combined variable and non-dietary variables with non-communicable disease early deaths as the dependent variable. With the standardized risk factors and non-communicable disease early deaths (dependent variable) data, I checked to determine that all the standardized variables were found. With proc corr, they were not found.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have used combined dietary variables before in multiple regression equations. Why does it not work here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Feb 2024 05:21:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/913911#M40918</guid>
      <dc:creator>dkcundiffMD</dc:creator>
      <dc:date>2024-02-01T05:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Risk factors combined variable in a multiple regression was not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/913987#M40921</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292162"&gt;@dkcundiffMD&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DATA step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data source2;
 set Projects.source;
where (NCD17m2 &amp;lt;1070.22659 and afoods2 &amp;lt;400) or afoods2 &amp;lt;149;
  NCD17m2f1=  
- pmeat17KC2s * 1.45735 * 0.159272828
- rmeat17KC2s * 17.0053 * 0.197695837
...
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;must have caused a lot of notes in the log saying&lt;/P&gt;
&lt;PRE&gt;NOTE: Variable pmeat17KC2s is uninitialized.
NOTE: Variable rmeat17KC2s is uninitialized.
...&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
...&lt;/PRE&gt;
&lt;P&gt;because all those standardized variables are not contained in dataset PROJECTS.SOURCE, which the SET statement reads, but were defined in a previous DATA step that created another WORK dataset named SOURCE2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, the above DATA step must read that SOURCE2 dataset and should ideally write the results to a dataset with a different name to avoid overwriting the previous one (and the risk of confusion). But first you need to rerun the DATA step creating the standardized variables because now you have overwritten it. Better yet, check if &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_stdize_overview.htm" target="_blank" rel="noopener"&gt;PROC STDIZE&lt;/A&gt; can compute the standardized variables with much less code and without copying (rounded!) descriptive statistics into the code window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The structure of the code could be like this:&lt;/P&gt;
&lt;PRE&gt;/* Create the analysis subset */

data source2;
set Projects.source;
where (NCD17m2 &amp;lt;1070.22659 and afoods2 &amp;lt;400) or afoods2 &amp;lt;149;
run;

/* Create standardized variables */

proc stdize data=source2 out=&lt;STRONG&gt;source2s&lt;/STRONG&gt; sprefix=s_ method=...;
var NCD17m2 Pmeat17KC2 ...;
run;

/* Compute correlations */

proc corr data=source2s;
...;
run;

/* Combine risk factors */

data &lt;STRONG&gt;source2c&lt;/STRONG&gt;;
set source2s;
NCD17m2f1= ...;
run;

/* Compute more correlations */

proc corr data=source2c;
...;
run;&lt;/PRE&gt;
&lt;P&gt;Most likely the DATA step creating dataset SOURCE2C could be modified to read not only SOURCE2S, but also an output dataset from the statistical procedure (PROC CORR?) which has computed the statistics used in the formula for variable&amp;nbsp;NCD17m2f1.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 10:35:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/913987#M40921</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-01T10:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Risk factors combined variable in a multiple regression was not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914159#M40923</link>
      <description>&lt;P&gt;That solution worked to get the variables standardized in a new workspace (source3). Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I can't get proc stdize to work. My effort is attached. It would save me many hours to quickly standardize lots of variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 05:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914159#M40923</guid>
      <dc:creator>dkcundiffMD</dc:creator>
      <dc:date>2024-02-02T05:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Risk factors combined variable in a multiple regression was not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914181#M40924</link>
      <description>&lt;P&gt;By default, the output dataset from PROC STDIZE (i.e. SOURCE3S in your example) uses the &lt;EM&gt;original&lt;/EM&gt; names for the standardized variables: see the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_stdize_syntax01.htm#statug.stdize.outopt" target="_blank" rel="noopener"&gt;description of the OUT= option in the documentation&lt;/A&gt;. But you can opt for new names by specifying the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_stdize_syntax01.htm#statug.stdize.sprefixopt" target="_blank" rel="noopener"&gt;SPREFIX= option&lt;/A&gt;&amp;nbsp;and for including the original variables in the output dataset by using the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_stdize_syntax01.htm#statug.stdize.oprefixopt" target="_blank" rel="noopener"&gt;OPREFIX= option&lt;/A&gt;&amp;nbsp;(alone or together with the SPREFIX= option). In both cases you name a &lt;EM&gt;prefix&lt;/EM&gt;, not a suffix, to be added to the original variable names. Then use the names of the standardized variables to refer to them in later steps (e.g. PROC CORR). To check the variable names you can use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1qifqw1gmvps3n1d593m2p63mdd.htm" target="_blank" rel="noopener"&gt;PROC CONTENTS&lt;/A&gt; and/or &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n17dcq1elcvpvkn1pkecj41cva6j.htm" target="_blank" rel="noopener"&gt;PROC PRINT&lt;/A&gt;&amp;nbsp;(the latter with an OBS= dataset option such as&lt;/P&gt;
&lt;PRE&gt;proc print data=source3s&lt;STRONG&gt;(obs=5)&lt;/STRONG&gt;;
run;&lt;/PRE&gt;
&lt;P&gt;to limit the output to a few [here: 5] observations.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note that you don't need to repeat the WHERE condition over and over again. Once the condition has been applied (i.e. in dataset SOURCE2 in the code I suggested), all observations in the dataset necessarily satisfy the condition and applying the WHERE statement again is just redundant -- as long as the variable values are not changed. (If you instruct PROC STDIZE to use the original names for the standardized variables, then their values &lt;EM&gt;do&lt;/EM&gt; change, of course, and you certainly don't want to apply the same WHERE condition that suited the variables before standardization.)&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 10:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914181#M40924</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-02T10:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Risk factors combined variable in a multiple regression was not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914441#M40929</link>
      <description>&lt;P&gt;Now I'm having problem with the proc contents syntax.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 18:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914441#M40929</guid>
      <dc:creator>dkcundiffMD</dc:creator>
      <dc:date>2024-02-04T18:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Risk factors combined variable in a multiple regression was not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914444#M40930</link>
      <description>&lt;P&gt;You're welcome. If you just want to see the list of variables in a dataset, say, in dataset SOURCE5, you can use the simple syntax&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=source5;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Only rarely you'll need &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p1v2467vdjbp7xn1222c7t3sejz3.htm#n1x7c61arqfpc5n1nnhy5r36sjoz" target="_blank" rel="noopener"&gt;more options&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 18:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914444#M40930</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-04T18:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Risk factors combined variable in a multiple regression was not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914449#M40931</link>
      <description>That works! I was putting in variables and getting errors. Thanks.</description>
      <pubDate>Sun, 04 Feb 2024 23:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Risk-factors-combined-variable-in-a-multiple-regression-was-not/m-p/914449#M40931</guid>
      <dc:creator>dkcundiffMD</dc:creator>
      <dc:date>2024-02-04T23:24:43Z</dc:date>
    </item>
  </channel>
</rss>

