I have epidemiologic data. I am trying to plot the regression:
y = 76.450438 + 0.047259*x_1 + 0.882275*x_2
I found this regression from analysis using my data. I have tried to use plot3d, planes3d, plotly, and a number of other commands to plot this plane (this is a plane, correct?). And yes, I made sure there are no errors regarding libraries or other syntax. I am at the point where the input is accepted by RStudio, but the 3D plot comes up empty, no box, no points, just the letters x y and z in thin air.
Also, is it possible to overlay one regression plane on another in the same 3D plot? I want to compare two regression models within the same plot if possible. Is it also possible to overlay the regression plane on a scatterplot of the data?
Any advice is much appreciated. Thank you.
EpiSimulationRelevant$age <- x
EpiSimulationRelevant$totchol <- y
EpiSimulationRelevant$sysbp <- z
fit <- lm(z ~ x + y)
coefs <- coef(fit)
a <- coefs["x"]
b <- coefs["y"]
c <- -1
d <- coefs["(Intercept)"]