library(bios6312)

The following function are available:

To get help on any function, you can access the documentation with ?example_function.

We will use the built-in mtcars dataset to demonstrate each function.

head(mtcars)
my_model <- lm(mpg~wt, data=mtcars)

summary(my_model)
get_robust_variance(my_model)
get_studentized_residuals(my_model)
qqnorm_studentized_residuals(my_model)
studentized_residuals_vs_fitted_plot(my_model)
studentized_residuals_vs_predictors_plot(my_model)

For the next functions, we will need to use a model with interactions.

my_interaction_model <- lm(mpg ~ wt*cyl, data=mtcars)

summary(my_interaction_model)
# Replicates the `testparm` function in Stata
# Test if beta2 + beta3 == 0
testparm(par=c(3,4),
         model=my_interaction_model,
         type="F")
# Replicates the `lincom` function in Stata
# Estimates beta2 + 3.2beta3
lincom(par=c(3,4),
       mult=c(1,3.2),
       model=my_interaction_model)


maxdrohde/bios6312 documentation built on March 13, 2021, 1:50 p.m.