Hi all,
I would like to create weighted genetic risk scores using a combination of 27 SNPs (variables) and divide by the sum of the used weights.Then, I would like to determine the best score(s) using correlation with 2 outcomes.
This is the code I have been using to create one score and I have to repeat this using different combinations.
gen WtRiskScore= (a1X1+ a2X2+ a3X3+ anXn) / (a1+a2+a3+an)/n
pwcorr WtRiskScore outcome1 outcome1, sig
I know I have to use 'foreach' but not sure how I can ask stata to use different combinations.
Any advice is MUCH appreciated.. Thank you!
Dana
Related Posts with Generating scores using combinations of weighted variables and dividing by the sum of weights
Graph dot: General DoubtHello I want to make a comparative graph between the results that I have. There are four variables …
Loop to generate dummies indicating maximum values within each groupDear all, I am trying to generate a loop to create dummy variables for maximum values of a variable…
Interaction term significant; main terms significant but with an opposite signDear colleagues, I am studying the effect of hospital efficiency on absorbing the negative impact o…
Comparing coefficients across logit modelsHi all, I've developed a logit model to be applied to three different sets of cross-sectional data(t…
Categorical variable and the constantHello! Please bare with me for this question. I'm a STATA novice and have just begun learning about …
Subscribe to:
Post Comments (Atom)
0 Response to Generating scores using combinations of weighted variables and dividing by the sum of weights
Post a Comment