Skip to content

compute_lm_fit_df

Description

Fits a linear model of input dataframe

Usage

compute_lm_fit_df(
data,
xdata_col,
ydata_col,
conf_int = 0.95
)

Arguments

NameDescription
dataQTc dataset
xdata_colan unquoted column name of x data
ydata_colan unquoted column name of y data
conf_intconfidence interval

Returns

the fitted parameters of a lm of y ~ x

Examples

data <- preprocess(data)
compute_lm_fit_df(data, RR, QT)
compute_lm_fit_df.R
# A tibble: 1 × 9
intercept slope intercept_ci_lower intercept_ci_upper slope_ci_lower
<dbl> <dbl> <dbl> <dbl> <dbl>
1 280. 0.107 271. 289. 0.0974
# ℹ 4 more variables: slope_ci_upper <dbl>, p_value_intercept <dbl>,
# p_value_slope <dbl>, conf_int <dbl>