Beta regression with bounded predictor

Oh, I see. So your outcome variable is bounded between zero and one, so you used zero-one-inflated Beta regression to capture this property in your model. No matter what values of predictors you pass, your outcome variable will always be bounded.

In contrast, these models (and most models that I am familiar with) don’t make any assumptions about the distribution of your predictor variables. In this case your predictor is also bounded between zero and one, but the model doesn’t know that. And, since you are fitting straight lines in the model space, you can ask your model what the value of the outcome variable would be if the predictor had a value of two.

Below I code up a quick example of predicting race time in seconds by a person’s height in centimeters. Even though there is no height data that is negative, and theoretically we know that you can’t have a negative height, we can still predict what someone’s racetime might be if they had a height of negative forty centimeters. This is why the plot_predictions() function only visualizes the regression line for where you actually have data. There might be some instances where it makes sense to extrapolate your regression beyond where you presently have data, but most of the time I would be hesitant to assume the linear trend extends beyond where the model was informed by data.

library(marginaleffects)

set.seed(123)
height_cm <- rnorm(30, mean = 175, sd = 10)
time_s <- rnorm(30, mean = 30 + (height_cm*-0.1), sd = 1)

df <- data.frame(height_cm, time_s)

model <- lm(time_s ~ height_cm, data = df)

predictions(model,
            newdata = datagrid(height_cm = -40))

 height_cm Estimate Std. Error    z Pr(>|z|)    S 2.5 % 97.5 %
       -40     37.1       3.41 10.9   <0.001 88.9  30.4   43.7

Columns: rowid, estimate, std.error, statistic, p.value, s.value, conf.low, conf.high, time_s, height_cm 
Type:  response 

The only way I know of to let the model know the predictor is bounded is when you use monotonic variables to enter ordinal predictor variables into the regression.