I have a function
predictshrine<-0*rain-399.8993+5*crops+50.4296*log(citysize)+
4.5071*wonders*chief+.02301*children*deaths+1.806*children+
.10799*deaths-2.0755*wonders-.0878*children^2+.001062*children^3-
.000004288*children^4-.009*deaths^2+.0000530238*deaths^3+
7.974*sqrt(children)+.026937*wonders^2-.0001305*wonders^3
I also have a sequence
children<-seq(0,100,length=500)
And a for loop
for(deaths in c(0,5,10,50,100,200))
Now what i want to do is be able to plot predictshrine vs children when deaths equals certain amounts and display those graphs all at once with the par(mfrow) function
I have
plot(predictshrine, children)
I want to be able to do this function when death=0, when death=10, when death=50 etc.
That way I could have 6 different graphs showing the change in the regression
Ideally i could do something like
plot(predictshrine, children, when deaths = 10 & 20 & 50)
but that won't work as code.
I want to incorporate my 4 loop into the equation.
Just to make it clear, deaths and children are two variables in my multivariable equation
Thanks in advance
-Max