# [R-sig-ME] confidence intervals for interpolated values in logistic regression

Phillip Alday ph||||p@@|d@y @end|ng |rom mp|@n|
Mon May 25 01:06:45 CEST 2020

```This isn't a mixed-models issue, so it's not quite on-topic for the
list, but I'll go ahead and give a few hints:

1. Don't do the linear algebra yourself -- use predict(). This is
especially true for GAMs where you need to worry about the smoother
terms (and where the necessary matrices for the linear algebra isn't
immediately obvious from the model summaries). (Also,l you mention GAMs,
but then you don't mention any smoothers .... )

2. I think the functionality you're looking for is more or less the
effects package.

3. There is some fine print on that though: there are confidence
intervals (which summarize your model and its uncertainty and are what
are shown in effects plots) and prediction intervals (which show how
much variability you would expect in new data -- and this is more than
the confidence intervals, which summarize the uncertainty in your
parameters, not total variability).

4. mgcv may have a relevant parametric boostrap method, but I don't
think is what you're looking for. mgcv does have some nice plotting
methods built-in though in addition to the methods in the effects package.

Best,
Phillip

On 14/4/20 4:29 pm, David Villegas Ríos wrote:
> Dear list,
> I´m running a gam model (package mgcv) with a binary response variable (y),
> and two continuous explanatory variables (x and z), plus their interaction
> (x:z). I, therefore, obtain four coefficients from my model (intercept,
> slope of x, slope of z and interaction coefficient).
>
> I´m interested in obtaining the value of one of the explanatory variables
> (x) for a particular level of the response variable, i.e. for a particular
> probability level, and after fixing the value of the other explanatory
> variable (z). Doing simple arithmetic, I can obtain the value of x that I´m
> looking for, but I wonder how I can obtain a measure of error such a
> confidence interval, so I can compare that value obtained from other
> analogous models.
>
> Is bootstrapping a good option or are there better alternatives? Any
> practical advice/library to do so?
>
> Thanks in advance,
> David
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

```