is an option for LinearModelFit and other fitting functions that specifies whether a constant term should be included if not explicitly given in the list of basis functions.
IncludeConstantBasis
is an option for LinearModelFit and other fitting functions that specifies whether a constant term should be included if not explicitly given in the list of basis functions.
Details
- The default setting IncludeConstantBasis->True adds a constant basis to the model if one is not specified in the list of basis functions.
- Linear and generalized linear models typically compare the fitted model to the mean response model, which contains only a constant basis function.
- Setting IncludeConstantBasis->False can be used to fit models without a constant basis function.
Examples
open all close allBasic Examples (1)
Scope (2)
Fit a generalized linear model:
data = {{1, 1}, {2, .5}, {3, 2}, {5, 6}};GeneralizedLinearModelFit[data, x, x, ExponentialFamily -> "Gamma"]//NormalFit the model without a constant term in the linear predictor:
GeneralizedLinearModelFit[data, x, x, ExponentialFamily -> "Gamma", IncludeConstantBasis -> False]//NormalFit logit models with and without a constant term:
LogitModelFit[{.1, .3, .5, .6, .8}, x, x]//NormalLogitModelFit[{.1, .3, .5, .6, .8}, x, x, IncludeConstantBasis -> False]//NormalProbitModelFit[{.1, .3, .5, .6, .8}, x, x]//NormalProbitModelFit[{.1, .3, .5, .6, .8}, x, x, IncludeConstantBasis -> False]//NormalHistory
Text
Wolfram Research (2008), IncludeConstantBasis, Wolfram Language function, https://reference.wolfram.com/language/ref/IncludeConstantBasis.html.
CMS
Wolfram Language. 2008. "IncludeConstantBasis." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IncludeConstantBasis.html.
APA
Wolfram Language. (2008). IncludeConstantBasis. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IncludeConstantBasis.html
BibTeX
@misc{reference.wolfram_2026_includeconstantbasis, author="Wolfram Research", title="{IncludeConstantBasis}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/IncludeConstantBasis.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_includeconstantbasis, organization={Wolfram Research}, title={IncludeConstantBasis}, year={2008}, url={https://reference.wolfram.com/language/ref/IncludeConstantBasis.html}, note=[Accessed: 13-June-2026]}