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
Mlabcolor, mlabsize, etc. not changing in scatter plot since Stata updateHello, I have been having a number of issues with my graphics in Stata (16, updated with every new …
Some questions about Correlation Random Effect ModelDear Statalisters: Thanks for reading it! I'm using a two-period panel data to figure out the impa…
How to insert a blank line by group* Example generated by -dataex-. For more info, type help dataex clear input str1 var1 float group "…
Update to -addplot- available from SSCaddplot now has a nodraw option to prevent refreshing the graph window each time addplot is called. …
Generate variable (maybe needs a loop)I have the following data set: Parent Subsidiary Variable Value US UK revenue 10 US FRA revenue 15 …
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