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
Help with merging two datasetsDear all, I am using Stata 16, on mac. I have attached the two excel datasets that I am working wit…
replace with the last row in each goup Hi STATALIST, Could you please help me to replace meacstdivol_1 with last row within each study_1?…
Dummy variables in first difference regressionHi guys, I have a potentially very stupid question to ask, but for the life of me I can not figure …
Problem with variables names inside loopsHi all, I have a set of variables named "ratio_##########_co_###" (where # are numbers). My proble…
Fine and Gray calculate individual risksDear all, I would like to calculate the 10-year risk of stroke for each individual in my dataset, g…
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