Skip to contents

Fit linear regression model on a continuous endpoint.

Usage

fitLinear(endpoint, placebo, data, alternative, ...)

Arguments

endpoint

Character. Name of the endpoint in data.

placebo

Character. String indicating the placebo in data$arm.

data

Data frame. Usually it is a locked data set.

alternative

a character string specifying the alternative hypothesis, must be one of "greater" or "less". No default value. "greater" means superiority of treatment over placebo is established by a greater mean in treated arm because a linear regression model is fitted with endpoint ~ I(arm != placebo).

...

Subset conditions compatible with dplyr::filter. glm will be fitted on this subset only. This argument can be useful to create a subset of data for analysis when a trial consists of more than two arms. By default, it is not specified, all data will be used to fit the model. More than one condition can be specified in ..., e.g., fitLinear('cfb', 'pbo', data, arm %in% c('pbo', 'low dose'), cfb > 0.5), which is equivalent to: fitLinear('cfb', 'pbo', data, arm %in% c('pbo', 'low dose') & cfb > 0.5). Note that if more than one treatment arm are present in the data after applying filter in ..., models are fitted for placebo verse each of the treatment arms.

Value

a data frame with three columns:

p

one-sided p-value for between-arm difference (treated vs placebo).

info

sample size in the subset with NA being removed.

z

the z statistics of between-arm difference (treated vs placebo).