I am new to R and would like to follow the answer to this: Simulation of logistic regression power analysis - designed experiments

I would like specifically to know if I have power to detect a contribution to the model in an interacting co-variate term (Combined represents gene*prs_standardised). My data is case/control group with polygenic risk score and a mix of other continuous and binary covariates.

In order to do this I would like to simulate my own dataset, the model summary is below: enter image description here

Whilst the P-value for combined implied there is no contribution to the model I am doubtful I am powered to detect this signal and would like to check.

In order to simulate a dataset like this do I need to randomly generate tables/models by setting the parameters for the random numbers based of the min/max/sd of each coefficient? I am not too sure how to do that and any help would be greatly appreciated.

Ideally there would be some kind of code that will look at the distribution of each column making up a coefficient of the table and then simulate data based of it's distribution?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.