# Modeling two variable non-linear regression

I would like to fit a model to the data set that has two predictors, wind and relative humidity, and the response is inoculum production. The response to increasing in RH is sigmoid. I am not really sure how to approach this. I do not know how to fit a non-linear model (for example logistic) to data with multiple variables. The data comes from an old article and only means are available for each combination of factor levels.
The data:

dis_df <- structure(list(rh = c(100, 95, 90, 85, 80, 100, 95, 90, 85, 80,
100, 95, 90, 85, 80, 100, 95, 90, 85, 80), wind = c(0.3, 0.3,
0.3, 0.3, 0.3, 1.4, 1.4, 1.4, 1.4, 1.4, 5.5, 5.5, 5.5, 5.5, 5.5,
13.7, 13.7, 13.7, 13.7, 13.7), spor = c(66927, 83117, 76360,
17542, 7857, 95804, 98221, 17147, 4384, 69, 90982, 7741, 179,
93, 185, 139531, 4887, 292, 417, 0)), row.names = c(NA, -20L), class = c("tbl_df",
"tbl", "data.frame"))


Some visualisation:

ggplot(spor_df, aes(factor(spor_df\$wind, levels = c("0.3", "1.4", "5.5", "13.7")), rh))+
geom_tile(aes(fill = spor))+
xlab("Wind (m/s)")+
scale_fill_gradient(low = "lightgray", high = "black")

• Before you worry about fitting a model, you need to have a model. Can you provide the model equation? – Roland Jun 4 '19 at 10:28

I would look at the data in e.g. a visualisation like this:

library(tidyverse)

dis_df <- tibble(rh = c(100, 95, 90, 85,
80, 100, 95, 90,
85, 80,100, 95,
90, 85, 80, 100,
95, 90, 85, 80),
wind = c(0.3, 0.3,0.3, 0.3,
0.3, 1.4, 1.4, 1.4,
1.4, 1.4, 5.5, 5.5,
5.5, 5.5, 5.5, 13.7,
13.7, 13.7, 13.7, 13.7),
spor = c(66927, 83117, 76360, 17542,
7857, 95804, 98221, 17147,
4384, 69, 90982, 7741,
179, 93, 185, 139531,
4887, 292, 417, 0))

dis_df %>%
ggplot(aes(x = as_factor(rh), y = spor)) +
geom_point() +
scale_y_continuous(breaks = round(seq(min(dis_df$$spor), max(dis_df$$spor),
by = 20000),1),
labels = scales::comma) +
xlab("Mean Relative Humidity") +
ylab("Mean Spore Inoculum Production") +
facet_grid(~wind, labeller = label_both)


And calculate the (partial) correlations.

• I did look at data in a number of ways, and this being one of them just using line plots. Just thought this might be an interesting way to show it. I need this for inference, correlations are not really helpfull. – m_c Jun 4 '19 at 18:58