Basic linear regression on fuel efficiency of cars/trucks. Trouble with dims

After sampling you can set your mutable data to compare the 2 cases you care about and do posterior predictive with the fitted trace. You will get predictive draws for the “2 observations” corresponding to the cases you care about directly.

If you want to compare the predictive effect of a single variable (“holding the others constant”), you have to decide how to do that. Maybe set the other variables to their mean. Or you can add a couple of observations with the observed range of the “other variables” to both groups (so now you will have 2 * n cases instead of just 2 * 1), and then ignore those and look only at “car” vs “truck” or whatever you cared about.

In general, there is no one way to ask questions for your fitted model.

1 Like