View source: R/glm_regression.R
nt_simple_glm | R Documentation |
Fit simple GLM.
nt_simple_glm(
data,
response,
...,
family,
robust.variance = NULL,
increment = NULL,
ci.type = "Wald",
conf.level = 0.95,
exponentiate = FALSE,
format = TRUE,
labels = NULL,
digits = 2,
digits.p = 3,
save = FALSE,
file = "simple_logistic"
)
data |
a data frame with the variables. |
response |
a character value indicating the response variable. |
... |
character values indicating confounding variables. |
family |
a character indicating family distribution. See more |
robust.variance |
a function yielding a covariance matrix or a covariance matrix. See more |
increment |
a named list indicating the magnitude of increments to calculate odds ratio for continuous covariates. |
ci.type |
a character value indicating the procedure to calculate confidence intervals: likelihood ratio ( |
conf.level |
a numerical value indicating the confidence level for parameters of interest. |
exponentiate |
a logical value indicating whether coefficients should be exponentiated. |
format |
a logical value indicating whether the output should be formatted. |
labels |
a list of labels with components given by their variable names. |
digits |
a numerical value defining of digits to present the results. |
digits.p |
a numerical value defining number of digits to present the p-values. |
save |
a logical value indicating whether the output should be saved as a csv file. |
file |
a character indicating the name of output file in csv format to be saved. |
library(titanic)
library(dplyr)
data(titanic_train)
titanic_nt <- titanic_train |>
mutate(Sex = factor(Sex,
levels = c("male", "female"),
labels = c("Male", "Female")),
Pclass = factor(Pclass,
levels = 1:3,
labels = c("I", "II", "III")),
Embarked = factor(Embarked,
levels = c("C", "Q", "S"),
labels = c("Cherbourg", "Queenstown", "Southampton")))
titanic_nt |> select(Survived, Sex, Age, Pclass, Embarked) |>
nt_simple_glm(response = Survived, Age,
family = binomial(link = "logit"),
exponentiate = TRUE,
labels = list(Pclass = "Passenger class"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.