rondolab / MR-PRESSO

Performs the Mendelian Randomization Pleiotropy RESidual Sum and Outlier (MR-PRESSO) method.
83 stars 30 forks source link

Not enough instrumental variables #3

Closed nvanzuy closed 5 years ago

nvanzuy commented 6 years ago

Hi there,

Just wondering if you could clarify something?

I'm wondering what this particular error message is checking. If I am providing a dataframe with my Beta and standard errors for Exposure and outcome for the same number of SNPs when would nrow(data)>length(BetaExposure)+2?

Thanks, Natalie

rondolab commented 6 years ago

Hi, this error is checking whether there are enough instrumental variables to run the method. Since we are running a regression model on the instrumental variables (as observations) the number of instrumental variables must be greater than the number of estimated parameters in the model for the estimations and statistical tests to run. Best.

Steven-ZWQ commented 1 year ago

Hi Ron, I cannot understand this Prerequisite- "if(nrow(data) <= length(BetaExposure) + 2) stop("Not enough intrumental variables")". Why did "nrow(data)" not equate to "length(BetaExposure)"? What is the minimum number of genetic variants as instrumental variables? I look forward to your reply. Best regards, Wenqiang.

huntPis commented 9 months ago

Hi Steven-ZWQ, I am also confused by "if(nrow(data) <= length(BetaExposure) + 2) stop("Not enough intrumental variables")", do you got any idea about this issue? is the data mean harmonise result here? then nrow(data) should be equate to "length(BetaExposure), looking forward to reply. Best regards, Yanfeng.