mymodel <- lm(r_shift ~ median_income16 + any_college, data = cali_counties)
xvars <- data.frame(x1 = seq(min(cali_counties$median_income16, na.rm=TRUE),
max(cali_counties$median_income16, na.rm=TRUE),
length.out=10),
x2 = seq(min(cali_counties$any_college, na.rm=TRUE),
max(cali_counties$any_college, na.rm=TRUE),
length.out=10))
predicted_xvars_data <- create_y_estimates(x_vals = xvars,
model = mymodel,
coefficient_names = c(y = "r_shift",
x1= "median_income16",
x2= "any_college") )
Run the code above in your browser using DataLab