There are functions in the emdbook, metafor, and car packages that do some version of the delta method (although people use "delta method" to refer both to adjusting E[f(y)] using a second-order correction [since the first-order term disappears] and to adjusting V[f(y)] using a first-order correction ...) emmeans also has such capabilities, search the vignettes for "bias correction" cheers Ben Bolker On Thu, Mar 19, 2026 at 8:57?AM Christofer Bogaso <bogaso.christofer at gmail.com> wrote:> > Hi, > > In many case, we need to transform the dependent variable before > fitting a regression equation, to make it "well-behaved" like close to > normal curve etc. > > like, > > f(y) = alpha + beta1 X1 + beta2 X2 + ... + epsilon > > Now for prediction, R will typically calculate E[f(y)] based on the > fitted coefficients. However, in real scenario, we actually need to > find E[y]. > > Typically, we perform reverse transformation like on fitted E[f(y)] directly. > > However, I believe that in this process, we also need to make some > additional correction for non-linearity in the f() to correctly > calculate E[y]. Onr possible way to do it, may be using Taylors > approximation. > > My question is there any R function that would directly do that based > on the shape of f()? > > Thanks for your time. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide https://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Not to be the guy who won't answer the question, but perhaps regression is not the best modeling method if there is significant non-linearity in the relationship you are investigating and you are not sure about the nature of that non-linearity. You can generally produce a reasonable linear approximation if the range of the target variable is narrow enough, but such models often have very limited applications. Out of interest, what regression technique(s) are you using? LMH Ben Bolker wrote:> There are functions in the emdbook, metafor, and car packages that > do some version of the delta method (although people use "delta > method" to refer both to adjusting E[f(y)] using a second-order > correction [since the first-order term disappears] and to adjusting > V[f(y)] using a first-order correction ...) > > emmeans also has such capabilities, search the vignettes for "bias correction" > > cheers > Ben Bolker > > On Thu, Mar 19, 2026 at 8:57?AM Christofer Bogaso > <bogaso.christofer at gmail.com> wrote: >> >> Hi, >> >> In many case, we need to transform the dependent variable before >> fitting a regression equation, to make it "well-behaved" like close to >> normal curve etc. >> >> like, >> >> f(y) = alpha + beta1 X1 + beta2 X2 + ... + epsilon >> >> Now for prediction, R will typically calculate E[f(y)] based on the >> fitted coefficients. However, in real scenario, we actually need to >> find E[y]. >> >> Typically, we perform reverse transformation like on fitted E[f(y)] directly. >> >> However, I believe that in this process, we also need to make some >> additional correction for non-linearity in the f() to correctly >> calculate E[y]. Onr possible way to do it, may be using Taylors >> approximation. >> >> My question is there any R function that would directly do that based >> on the shape of f()? >> >> Thanks for your time. >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide https://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Thanks Ben.
Could you please help pointing out names of specific functions on Bias
correction? I searched with like ls('package:emdbook') etc. however
failed to identify relevant functions.
On Thu, Mar 19, 2026 at 6:55?PM Ben Bolker <bbolker at gmail.com>
wrote:>
> There are functions in the emdbook, metafor, and car packages that
> do some version of the delta method (although people use "delta
> method" to refer both to adjusting E[f(y)] using a second-order
> correction [since the first-order term disappears] and to adjusting
> V[f(y)] using a first-order correction ...)
>
> emmeans also has such capabilities, search the vignettes for "bias
correction"
>
> cheers
> Ben Bolker
>
> On Thu, Mar 19, 2026 at 8:57?AM Christofer Bogaso
> <bogaso.christofer at gmail.com> wrote:
> >
> > Hi,
> >
> > In many case, we need to transform the dependent variable before
> > fitting a regression equation, to make it "well-behaved"
like close to
> > normal curve etc.
> >
> > like,
> >
> > f(y) = alpha + beta1 X1 + beta2 X2 + ... + epsilon
> >
> > Now for prediction, R will typically calculate E[f(y)] based on the
> > fitted coefficients. However, in real scenario, we actually need to
> > find E[y].
> >
> > Typically, we perform reverse transformation like on fitted E[f(y)]
directly.
> >
> > However, I believe that in this process, we also need to make some
> > additional correction for non-linearity in the f() to correctly
> > calculate E[y]. Onr possible way to do it, may be using Taylors
> > approximation.
> >
> > My question is there any R function that would directly do that based
> > on the shape of f()?
> >
> > Thanks for your time.
> >
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
https://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.