
Create data frame used to plot a surface of predicted y values
Source:R/create_plot_data.R
create_surface_data.Rd
Create data frame used to plot a surface of predicted y values. There can be only exactly 2 columns of x values. The predicted y values can be estimated from an lm or glm model. Interaction terms are allowed, as are weights.
Value
A data frame with generated values for two x variables, as well as the predicted y values and predicted confidence intervals for each pair of x values. These can be used to plot the estimated regression surface and confidence interval surfaces.
Examples
mymodel <- lm(length ~ isFemale_num + isMale_num,
data = hair_data)
surface_data <- create_surface_data(data = hair_data,
model = mymodel)