Report of lm coefficients with p-value If a categorical variable is used, should be as x argument

lm_report(data, x, y)

Arguments

data

A data.frame

x

name of x variable (categorical variable)

y

name of y variable (continuous variable)

Value

A character of lm coefficients and p-value

Examples


# Summarize data by ID
sum_data <- data_501 |>
  dplyr::group_by(ID) |>
  dplyr::summarise_all(dplyr::first)

# Map categorical data
sum_data <- map_cat_data(sum_data, meta_data_501)

# ANOVA correlation with p-value
# Categorical variable, SEX, as x argument
lm_report(sum_data, x = "SEX", y = "WT")
#> [1] "(Intercept):74.147 (p<0.001)/Female:5.914 (p:0.094)"