library(readxl) library(janitor) library(tidyverse) library(gt) library(infer) library(psych) library(skimr) library(broom) library(sandwich) library(lmtest) library(rlm) library(reprex)
data <- read_csv("data_2/ohie_assignment2.csv") %>% na.omit() %>% clean_names() data %>% rlm(ed_visits ~ medicaid, data = data)
The error message I get reads "Error in rlm(., ed_visits ~ medicaid, data = data) : unused argument (data = data)"
I'm sure I'm doing something really stupid wrong, but I can't seem to figure out what it is... any ideas?
My code works when I run the standard lm, but I want to use the robust method... Would something like this accomplish the same thing as rlm?
model <- lm(ed_visits ~ medicaid, data = data) # This takes what I have done and saves the heteroscedastic robust standard error robust <- coeftest(model, vcov = vcovHC(model, "HC1"))
Created on 2020-03-16 by the reprex package (v0.3.0)