Prest Tracker
https://communities.sas.com/kntur85557/tracker
Prest TrackerTue, 16 Apr 2024 21:00:53 GMT2024-04-16T21:00:53ZRe: Principal components analysis for complex survey data
https://communities.sas.com/t5/SAS-Procedures/Principal-components-analysis-for-complex-survey-data/m-p/623531#M77332
Thank you so much.<BR /><BR />You seem to imply that including the complex survey information may not be necessary during derivation of Principal components. That the procedure stays the same as in simple random sample data analysis.<BR /><BR />Did I get you right?Mon, 10 Feb 2020 09:06:00 GMThttps://communities.sas.com/t5/SAS-Procedures/Principal-components-analysis-for-complex-survey-data/m-p/623531#M77332Prest2020-02-10T09:06:00ZPrincipal components analysis for complex survey data
https://communities.sas.com/t5/SAS-Procedures/Principal-components-analysis-for-complex-survey-data/m-p/623413#M77326
<P>Hello here.</P><P> </P><P>I am analysis national survey data with a complex study design therefore I would like to incorporate sampling weights</P><P>and account for clusters and stratum.</P><P> </P><P>I am using food frequency questionnaire data. I derived 24 food groups from 112 food items. I want to use Principal</P><P>components analysis to derive Dietary patterns. Please which procedure can I use to to run principal components</P><P>analysis for this kind of study design? </P><P>I know the <EM><STRONG>proc pls</STRONG></EM> procedure and the <EM><STRONG>proc factor</STRONG></EM> , but these are seem to be for data obtained by simple random sampling.</P><P>Any assistance would be accepted.</P>Sun, 09 Feb 2020 15:39:33 GMThttps://communities.sas.com/t5/SAS-Procedures/Principal-components-analysis-for-complex-survey-data/m-p/623413#M77326Prest2020-02-09T15:39:33ZP for trend in Proc surveylogisitic
https://communities.sas.com/t5/Statistical-Procedures/P-for-trend-in-Proc-surveylogisitic/m-p/617679#M29751
<P>Hello again. I want to run a logistic regression. My dependent variable is Mets and independent variable is Q (Quartiles of Dietary Inflammatory Index) (coded as 1,2,3,4) My covariates are age, Energy intake,BMI, education (coded 0, 1, 2), Alcohol(0,1), exercise (0,1),smoking(o,1) and physical exercise (0,1).</P><P> </P><PRE><CODE class=" language-sas">proc surveylogistic data = Project1.DII_M;
weight pooled_wt;
cluster psu;
strata kstrata;
class Q (reference = '1') educn(reference='2') smoking (reference='0') exercise (reference='1') Drinking (reference='0');
model Mets (desc) = age HE_BMI educn Drinking smoking exercise N_EN Q;
Domain sex;
run;</CODE></PRE><P> </P><P>I then want to calculate p for trend. To do this, I assigned the median value (Q_median) of the variable Adj_DII in each quartile category to each participant and modeled this as a continuous variable and read off the pr>t as my p for trend. </P><P> </P><P>I used the following code to determine median values, assigning them to participants and running a logistic regression.</P><PRE><CODE class=" language-sas">/*obtaining median in each quartile*/
proc report data=Project1.DII_Q out=dii_median;
columns sex Q Adj_DII;
define sex / group "Sexe";
define Q / group "Quartile";
define Adj_DII / median;
run;
/*Assigning median value to individuals*/
data Project1.DII_M;
set Project1.DII_Q;
if sex=1 and Q=1 then Q_median=-1.10;
else if sex=1 and Q=2 then Q_median=0.13;
else if sex=1 and Q=3 then Q_median=1.13;
else if sex=1 and Q=4 then Q_median=2.27;
else if sex=2 and Q=1 then Q_median=-1.22;
else if sex=2 and Q=2 then Q_median=0.10;
else if sex=2 and Q=3 then Q_median=1.06;
else if sex=2 and Q=4 then Q_median=2.06;
if HE_BMI LE 18.5 then BMI_cat=0;
else if 18.5 LT HE_BMI LT 23 then BMI_cat=1;
else if 23 LT HE_BMI LT 25 then BMI_cat=2;
else if HE_BMI GE 25 then BMI_cat=3;
Keep Age sex pooled_wt kstrata psu HE_BMI educn Drinking smoking exercise N_EN Q
Mets Hy_glu Abd_obs TG_high Low_HDL HTN Q_median Adj_DII BMI_cat ;
run;
/*obtaining p for trend..(method adopted from some paper*/
proc surveylogistic data = Project1.DII_M;
weight pooled_wt;
cluster psu;
strata kstrata;
model Mets(desc) = age HE_BMI educn Drinking smoking exercise N_EN Q_median;
Domain sex;
run;</CODE></PRE><P>The p for trend obtained in this paper was 0.008 whereas mine is 0.09 so far from this value. I would like to know where I went wrong. I have attached my working data set.</P>Thu, 16 Jan 2020 05:24:31 GMThttps://communities.sas.com/t5/Statistical-Procedures/P-for-trend-in-Proc-surveylogisitic/m-p/617679#M29751Prest2020-01-16T05:24:31ZRe: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS
https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617675#M19113
<P>Thank you. Proc summary produced the results I wanted. </P><P> </P><P>Thank you all for your effort.</P>Thu, 16 Jan 2020 04:45:28 GMThttps://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617675#M19113Prest2020-01-16T04:45:28ZRe: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS
https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617673#M19112
<P>This is excellent and very simple.</P>Thu, 16 Jan 2020 04:39:27 GMThttps://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617673#M19112Prest2020-01-16T04:39:27ZRe: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS
https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617670#M19110
<P>Hello. Thank you for the assistance. I think I didnt write it correctly. What I meant is that I already categorised data into Q1-Q4. I need to find the median of the variable Adj_DII in each of the Qs stratified by sex. </P>Thu, 16 Jan 2020 04:25:51 GMThttps://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617670#M19110Prest2020-01-16T04:25:51ZFINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS
https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617389#M19068
<P>hello here. I have the attached data set below from a National Health survey. Q indicates Quartiles that I created separately for women and men using the following code. </P><PRE><CODE class=" language-sas">Data Project1.DII_Q;
set Project1.DII_F;
if sex=1 and Adj_DII <=-0.382609 then Q=1;
if sex=1 and -0.382609 LT Adj_DII LE 0.618524 then Q=2;
if sex=1 and 0.618524LT Adj_DII LE 1.651765 then Q=3;
if sex=1 and Adj_DII> 1.651765 then Q=4;
if sex=2 and Adj_DII <=-0.486805 then Q=1;
if sex=2 and -0.486805 LT Adj_DII LE 0.598508 then Q=2;
if sex=2 and 0.598508 LT Adj_DII LE 1.533177 then Q=3;
if sex=2 and Adj_DII>1.533177 then Q=4;
run;</CODE></PRE><P> </P><P>Now I want to assign the median of the variable Adj_DII (in the attached data set) in each quartile category to individuals in that category separately by sex.But first, I want to find the median of Adj_DII in Q1, Q2, Q3, Q4 separately for men and women. I tried to use Proc survey means but didnt work. I need something like this;</P><P>For sex=1</P><P>median of Q1</P><P>median of Q2</P><P>median of Q3</P><P>median of Q4</P><P>And like wise for sex=2.</P><P> </P><P>I tried to use Proc survey means but didnt work.</P><PRE><CODE class=" language-sas">Proc surveymeans data=Project1.DII_Q median;
strata kstrata;
cluster psu;
weight pooled_wt;
Domain Q;
var Adj_DII;
run;</CODE></PRE><P>Kindly request for your assistance.</P><P> </P><P> </P><P> </P><P> </P>Wed, 15 Jan 2020 09:10:12 GMThttps://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617389#M19068Prest2020-01-15T09:10:12Zregression equation with gplot
https://communities.sas.com/t5/Statistical-Procedures/regression-equation-with-gplot/m-p/616838#M29724
<P>Hello again, I have another question.</P><P> </P><P>I am using SAS 9.4. I run a regression procedure using proc surveyreg and output residuals and predicted values which I was interested in. Now I want to obtain a predicted value of my dependent variable at a specific value of my independent variable. I thought about running regression again this time using the predicted values as my dependent valuable and use the intercept and slope from the table to manually calculate it but I am not sure this works. I used proc gplot to plot predicted values vs independent variable but could not obtain regression equation. What is the best way of doing this?</P><P> </P><P>proc surveyreg data=Project1.DII_Q;<BR />strata kstrata;<BR />cluster psu;<BR />weight pooled_wt;<BR />model DII = N_EN;<BR />output out=Project1.DII_Adj predicted=DII_pred residual = DII_resid;<BR />run;</P><P> </P><P>proc gplot data=Project1.DII_Adj ;<BR />plot DII_pred* N_EN/regeqn;<BR />run;</P>Mon, 13 Jan 2020 03:16:09 GMThttps://communities.sas.com/t5/Statistical-Procedures/regression-equation-with-gplot/m-p/616838#M29724Prest2020-01-13T03:16:09ZRegression equation on a gplot
https://communities.sas.com/t5/Statistical-Procedures/regression-equation-with-gplot/m-p/616837#M29725
<P>Hello again, I have another question.</P><P> </P><P>I am using SAS 9.4. I run a regression procedure using proc surveyreg and output residuals and predicted values which I was interested in. Now I want to obtain a predicted value of my dependent variable at a specific value of my independent variable. I thought about running regression again this time using the predicted values as my dependent valuable and use the intercept and slope from the table to manually calculate it but I am not sure this works. I used proc gplot to plot predicted values vs independent variable but could not obtain regression equation. What is the best way of doing this?</P><P> </P><P>proc surveyreg data=Project1.DII_Q;<BR />strata kstrata;<BR />cluster psu;<BR />weight pooled_wt;<BR />model DII = N_EN;<BR />output out=Project1.DII_Adj predicted=DII_pred residual = DII_resid;<BR />run;</P><P> </P><P>proc gplot data=Project1.DII_Adj ;<BR />plot DII_pred* N_EN/regeqn;<BR />run;</P>Mon, 13 Jan 2020 03:14:22 GMThttps://communities.sas.com/t5/Statistical-Procedures/regression-equation-with-gplot/m-p/616837#M29725Prest2020-01-13T03:14:22ZRe: Insufficient memory error with Proc surveyreg
https://communities.sas.com/t5/Statistical-Procedures/Insufficient-memory-error-with-Proc-surveyreg/m-p/616836#M29723
<P>Thank you so much for your effort</P><P> </P>Mon, 13 Jan 2020 03:03:02 GMThttps://communities.sas.com/t5/Statistical-Procedures/Insufficient-memory-error-with-Proc-surveyreg/m-p/616836#M29723Prest2020-01-13T03:03:02ZEnergy adjustment using the residual method.
https://communities.sas.com/t5/Statistical-Procedures/Energy-adjustment-using-the-residual-method/m-p/616392#M29707
<P>Hello here,</P><P>I want to obtain Energy Adjusted Dietary Inflammatory Index (DII). I used Proc surveyreg to run linear regression and obtain an output data set containing predicted values and residual Dietary inflammatory index values by modelling DII as dependent variables and Total energy intake as independent variable. To assume actual intake, I must add a constant to these residuals. This constant is the predicted DII value at mean total Energy intake according to Walter willett's paper "Adjustment for total energy intake intake in epidemiological studies".</P><P> </P><P>I don"t know how to write the sas code to obtain that constant. I need your help. Thanks.</P>Fri, 10 Jan 2020 07:30:57 GMThttps://communities.sas.com/t5/Statistical-Procedures/Energy-adjustment-using-the-residual-method/m-p/616392#M29707Prest2020-01-10T07:30:57ZInsufficient memory error with Proc surveyreg
https://communities.sas.com/t5/Statistical-Procedures/Insufficient-memory-error-with-Proc-surveyreg/m-p/615564#M29688
Hello<BR /><BR />I am running Proc surveyreg on 9253 observations and a class variable of 4 levels. I am trying to perform an ANOVA test to compare mean across those levels.<BR /><BR />However, I get the error "This procedure was cancelled due to insufficient memory".<BR /><BR />What should I do? Any help is appreciated.Tue, 07 Jan 2020 06:54:45 GMThttps://communities.sas.com/t5/Statistical-Procedures/Insufficient-memory-error-with-Proc-surveyreg/m-p/615564#M29688Prest2020-01-07T06:54:45Z