multiphenassoc()
take a distribution of PGS and multiple Phenotypes and eventual confounders
return a data frame showing the association results
multiphenassoc(
df = NULL,
prs_col = "SCORESUM",
phenotype_col = "Phenotype",
scale = TRUE,
covar_col = NA,
verbose = TRUE,
log = ""
)
return a data frame showing the association of the PGS on the Phenotypes with the following columns:
PGS: the name of the PGS
Phenotype: the name of Phenotype
Phenotype_type: either 'Continuous'
, 'Ordered Categorical'
, 'Categorical'
or 'Cases/Controls'
Stat_method: association function detects what is the phenotype type and what is the best way to analyse it, either 'Linear regression'
, 'Binary logistic regression'
, 'Ordinal logistic regression'
or 'Multinomial logistic regression'
Covar: list all the covariates used for this association
N_cases: if Phenotype_type is Cases/Controls, gives the number of cases
N_controls: if Phenotype_type is Cases/Controls, gives the number of controls
N: the number of individuals/samples
Effect: if Phenotype_type is Continuous, it represents the Beta coefficient of linear regression; Otherwise, it is the OR of logistic regression
SE: standard error of the Beta coefficient (if Phenotype_type is Continuous)
lower_CI: lower confidence interval of the related Effect (Beta or OR)
upper_CI: upper confidence interval of the related Effect (Beta or OR)
P_value: associated P-value
a dataframe with individuals on each row, and at least the following columns:
one ID column,
one PGS column, with numerical continuous values following a normal distribution,
one Phenotype column, can be numeric (Continuous Phenotype), character, boolean or factors (Discrete Phenotype)
a character specifying the PGS column name
a character vector specifying the Phenotype column names
a boolean specifying if scaling of PGS should be done before testing
a character vector specifying the covariate column names (facultative)
a boolean (TRUE by default) to write in the console/log messages.
a connection, or a character string naming the file to print to. If "" (by default), it prints to the standard output connection, the console unless redirected by sink.