create_summary_data: generation of summary level data

View source: R/mr_summarise.R

create_summary_dataR Documentation

generation of summary level data

Description

create_summary_data generates semi-summarized level data

Usage

create_summary_data(
  Ytype,
  q = 10,
  keep = FALSE,
  family = "gaussian",
  controlsonly = "TRUE",
  ...
)

Arguments

Ytype

The relationship between X and Y; can be "linear", "quad", "sqrt", "log", "threshold" or "fracpoly"

q

The number of quantiles.

keep

Whether to retain the individual level data as well as the summary data

family

a description of the error distribution and link function to be used in the model. For piecewise_mr this can be a character string naming either the gaussian (i.e. "gaussian" for continuous data) or binomial (i.e. "binomial" for binary data) family function.

controlsonly

whether to estimate the gx association in all people, or in controls only. This is set to TRUE as default. It has no effect if family is set to "gaussian"

...

parameters passed to mr_create_data for control of X-Y relationship

Value

summary A data-frame containing the semi-summarised beta_X and beta_Y values, mean of X_0, mean of X, max of X and min of X for each quantile.

Author(s)

Amy Mason


amymariemason/SUMnlmr documentation built on July 22, 2024, 10:03 a.m.