[{"data":1,"prerenderedAt":916},["ShallowReactive",2],{"content-query-BwsCL5mUEV":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"heading":10,"prompt":11,"tags":15,"files":17,"nav":6,"presets":18,"gallery":35,"body":37,"_type":909,"_id":910,"_source":911,"_file":912,"_stem":913,"_extension":914,"sitemap":915},"/tools/polynomial-regression","tools",false,"","Polynomial Regression Calculator for Excel & CSV","Run polynomial regression online from Excel or CSV data. Fit curved relationships, compare degrees, and inspect model fit with AI.","Polynomial Regression Calculator",{"prefix":12,"label":13,"placeholder":14},"Run a polynomial regression","Describe the polynomial regression you want to run","e.g. fit quadratic regression to age vs biomarker data, compare degree 1 2 3, report R² and coefficients",[16],"statistics",true,[19,25,30],{"label":20,"prompt":21,"dataset_url":22,"dataset_title":23,"dataset_citation":24},"CO₂ vs GDP curve","polynomial regression of CO2 emissions per capita vs log GDP per capita; fit degree 1 and degree 2; compare R²; plot quadratic fit with 95% confidence band; annotate the inflection point (EKC hypothesis)","https://ourworldindata.org/grapher/co-emissions-per-capita.csv","CO₂ emissions per capita","Our World in Data",{"label":26,"prompt":27,"dataset_url":28,"dataset_title":29,"dataset_citation":24},"Life expectancy vs GDP","polynomial regression of life expectancy vs log GDP per capita for the most recent year; fit degree 1 and 2; report R² for each; plot with confidence band; which degree fits better by AIC?","https://ourworldindata.org/grapher/life-expectancy-vs-gdp-per-capita.csv","Life expectancy vs. GDP per capita",{"label":31,"prompt":32,"dataset_url":33,"dataset_title":34,"dataset_citation":24},"Temperature over time","polynomial regression of global average temperature anomaly vs year; fit linear and quadratic trend; report acceleration term (degree 2 coefficient); plot with 95% confidence band; annotate rate of warming","https://ourworldindata.org/grapher/temperature-anomaly.csv","Global average temperature anomaly",[36],"/img/tools/polynomial-regression.png",{"type":38,"children":39,"toc":898},"root",[40,49,89,122,128,194,200,359,364,370,520,526,650,656,710,716,745,751,789,833,843,867],{"type":41,"tag":42,"props":43,"children":45},"element","h2",{"id":44},"what-is-polynomial-regression",[46],{"type":47,"value":48},"text","What Is Polynomial Regression?",{"type":41,"tag":50,"props":51,"children":52},"p",{},[53,59,61,66,68,73,75,80,82,87],{"type":41,"tag":54,"props":55,"children":56},"strong",{},[57],{"type":47,"value":58},"Polynomial regression",{"type":47,"value":60}," extends linear regression to model ",{"type":41,"tag":54,"props":62,"children":63},{},[64],{"type":47,"value":65},"curved relationships",{"type":47,"value":67}," between a predictor variable x and an outcome variable y. Instead of fitting a straight line (y = β₀ + β₁x), it fits a polynomial: ",{"type":41,"tag":54,"props":69,"children":70},{},[71],{"type":47,"value":72},"y = β₀ + β₁x + β₂x² + β₃x³ + … + βₙxⁿ",{"type":47,"value":74},". The ",{"type":41,"tag":54,"props":76,"children":77},{},[78],{"type":47,"value":79},"degree",{"type":47,"value":81}," of the polynomial determines the shape: degree 2 (quadratic) captures U-shaped or inverted-U-shaped curves; degree 3 (cubic) adds an S-shaped inflection; higher degrees fit increasingly complex shapes. Despite using higher powers of x, polynomial regression is still a ",{"type":41,"tag":54,"props":83,"children":84},{},[85],{"type":47,"value":86},"linear model",{"type":47,"value":88}," in the statistical sense — the coefficients β are estimated by ordinary least squares, and all the standard regression diagnostics (R², F-test, confidence intervals) apply directly.",{"type":41,"tag":50,"props":90,"children":91},{},[92,94,99,101,106,108,113,115,120],{"type":47,"value":93},"The most common application is fitting data where a straight line clearly misses the curvature. Classic examples include ",{"type":41,"tag":54,"props":95,"children":96},{},[97],{"type":47,"value":98},"growth curves",{"type":47,"value":100}," (plant height vs. days, which accelerates then decelerates), ",{"type":41,"tag":54,"props":102,"children":103},{},[104],{"type":47,"value":105},"dose-toxicity relationships",{"type":47,"value":107}," (low doses are safe, then toxicity rises sharply), ",{"type":41,"tag":54,"props":109,"children":110},{},[111],{"type":47,"value":112},"environmental Kuznets curves",{"type":47,"value":114}," (CO₂ emissions rise with early economic development, then fall as countries grow richer — a quadratic relationship), and ",{"type":41,"tag":54,"props":116,"children":117},{},[118],{"type":47,"value":119},"age-risk curves",{"type":47,"value":121}," (many disease biomarkers follow a U-shaped pattern across the lifespan). Before resorting to complex nonlinear models, a low-degree polynomial often captures the essential shape with interpretable coefficients and well-understood inference procedures.",{"type":41,"tag":42,"props":123,"children":125},{"id":124},"how-it-works",[126],{"type":47,"value":127},"How It Works",{"type":41,"tag":129,"props":130,"children":131},"ol",{},[132,143,159],{"type":41,"tag":133,"props":134,"children":135},"li",{},[136,141],{"type":41,"tag":54,"props":137,"children":138},{},[139],{"type":47,"value":140},"Upload your data",{"type":47,"value":142}," — provide a CSV or Excel file with at least one numeric predictor column and one numeric outcome column. One row per observation.",{"type":41,"tag":133,"props":144,"children":145},{},[146,151,153],{"type":41,"tag":54,"props":147,"children":148},{},[149],{"type":47,"value":150},"Describe the analysis",{"type":47,"value":152}," — e.g. ",{"type":41,"tag":154,"props":155,"children":156},"em",{},[157],{"type":47,"value":158},"\"fit polynomial regression of 'temperature' on 'year'; compare degree 1, 2, and 3; report R², AIC, and coefficients; plot fits with 95% confidence bands\"",{"type":41,"tag":133,"props":160,"children":161},{},[162,167,169,176,178,184,186,192],{"type":41,"tag":54,"props":163,"children":164},{},[165],{"type":47,"value":166},"Get full results",{"type":47,"value":168}," — the AI writes Python code using ",{"type":41,"tag":170,"props":171,"children":173},"a",{"href":172},"https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html",[174],{"type":47,"value":175},"scikit-learn",{"type":47,"value":177}," for polynomial feature expansion and ",{"type":41,"tag":170,"props":179,"children":181},{"href":180},"https://docs.scipy.org/doc/scipy/reference/stats.html",[182],{"type":47,"value":183},"scipy.stats",{"type":47,"value":185}," for confidence intervals, rendered with ",{"type":41,"tag":170,"props":187,"children":189},{"href":188},"https://plotly.com/python/",[190],{"type":47,"value":191},"Plotly",{"type":47,"value":193}," showing overlaid fits and a coefficient table",{"type":41,"tag":42,"props":195,"children":197},{"id":196},"required-data-format",[198],{"type":47,"value":199},"Required Data Format",{"type":41,"tag":201,"props":202,"children":203},"table",{},[204,228],{"type":41,"tag":205,"props":206,"children":207},"thead",{},[208],{"type":41,"tag":209,"props":210,"children":211},"tr",{},[212,218,223],{"type":41,"tag":213,"props":214,"children":215},"th",{},[216],{"type":47,"value":217},"Column",{"type":41,"tag":213,"props":219,"children":220},{},[221],{"type":47,"value":222},"Description",{"type":41,"tag":213,"props":224,"children":225},{},[226],{"type":47,"value":227},"Example",{"type":41,"tag":229,"props":230,"children":231},"tbody",{},[232,284,326],{"type":41,"tag":209,"props":233,"children":234},{},[235,246,251],{"type":41,"tag":236,"props":237,"children":238},"td",{},[239],{"type":41,"tag":240,"props":241,"children":243},"code",{"className":242},[],[244],{"type":47,"value":245},"x",{"type":41,"tag":236,"props":247,"children":248},{},[249],{"type":47,"value":250},"Predictor variable (numeric, continuous)",{"type":41,"tag":236,"props":252,"children":253},{},[254,260,262,268,269,275,276,282],{"type":41,"tag":240,"props":255,"children":257},{"className":256},[],[258],{"type":47,"value":259},"18",{"type":47,"value":261},", ",{"type":41,"tag":240,"props":263,"children":265},{"className":264},[],[266],{"type":47,"value":267},"25",{"type":47,"value":261},{"type":41,"tag":240,"props":270,"children":272},{"className":271},[],[273],{"type":47,"value":274},"40",{"type":47,"value":261},{"type":41,"tag":240,"props":277,"children":279},{"className":278},[],[280],{"type":47,"value":281},"55",{"type":47,"value":283}," (age in years)",{"type":41,"tag":209,"props":285,"children":286},{},[287,296,301],{"type":41,"tag":236,"props":288,"children":289},{},[290],{"type":41,"tag":240,"props":291,"children":293},{"className":292},[],[294],{"type":47,"value":295},"y",{"type":41,"tag":236,"props":297,"children":298},{},[299],{"type":47,"value":300},"Outcome variable (numeric)",{"type":41,"tag":236,"props":302,"children":303},{},[304,310,311,317,318,324],{"type":41,"tag":240,"props":305,"children":307},{"className":306},[],[308],{"type":47,"value":309},"12.3",{"type":47,"value":261},{"type":41,"tag":240,"props":312,"children":314},{"className":313},[],[315],{"type":47,"value":316},"18.7",{"type":47,"value":261},{"type":41,"tag":240,"props":319,"children":321},{"className":320},[],[322],{"type":47,"value":323},"31.2",{"type":47,"value":325}," (biomarker level)",{"type":41,"tag":209,"props":327,"children":328},{},[329,338,343],{"type":41,"tag":236,"props":330,"children":331},{},[332],{"type":41,"tag":240,"props":333,"children":335},{"className":334},[],[336],{"type":47,"value":337},"group",{"type":41,"tag":236,"props":339,"children":340},{},[341],{"type":47,"value":342},"Optional: categorical grouping",{"type":41,"tag":236,"props":344,"children":345},{},[346,352,353],{"type":41,"tag":240,"props":347,"children":349},{"className":348},[],[350],{"type":47,"value":351},"Male",{"type":47,"value":261},{"type":41,"tag":240,"props":354,"children":356},{"className":355},[],[357],{"type":47,"value":358},"Female",{"type":41,"tag":50,"props":360,"children":361},{},[362],{"type":47,"value":363},"Any column names work — describe them in your prompt.",{"type":41,"tag":42,"props":365,"children":367},{"id":366},"interpreting-the-results",[368],{"type":47,"value":369},"Interpreting the Results",{"type":41,"tag":201,"props":371,"children":372},{},[373,389],{"type":41,"tag":205,"props":374,"children":375},{},[376],{"type":41,"tag":209,"props":377,"children":378},{},[379,384],{"type":41,"tag":213,"props":380,"children":381},{},[382],{"type":47,"value":383},"Output",{"type":41,"tag":213,"props":385,"children":386},{},[387],{"type":47,"value":388},"What it means",{"type":41,"tag":229,"props":390,"children":391},{},[392,408,424,440,456,472,488,504],{"type":41,"tag":209,"props":393,"children":394},{},[395,403],{"type":41,"tag":236,"props":396,"children":397},{},[398],{"type":41,"tag":54,"props":399,"children":400},{},[401],{"type":47,"value":402},"Degree 1 coefficient (β₁)",{"type":41,"tag":236,"props":404,"children":405},{},[406],{"type":47,"value":407},"Linear slope — rate of change per unit x",{"type":41,"tag":209,"props":409,"children":410},{},[411,419],{"type":41,"tag":236,"props":412,"children":413},{},[414],{"type":41,"tag":54,"props":415,"children":416},{},[417],{"type":47,"value":418},"Degree 2 coefficient (β₂)",{"type":41,"tag":236,"props":420,"children":421},{},[422],{"type":47,"value":423},"Quadratic term — positive = U-shape (minimum), negative = ∩-shape (maximum)",{"type":41,"tag":209,"props":425,"children":426},{},[427,435],{"type":41,"tag":236,"props":428,"children":429},{},[430],{"type":41,"tag":54,"props":431,"children":432},{},[433],{"type":47,"value":434},"Vertex of quadratic",{"type":41,"tag":236,"props":436,"children":437},{},[438],{"type":47,"value":439},"x at maximum/minimum = −β₁/(2β₂)",{"type":41,"tag":209,"props":441,"children":442},{},[443,451],{"type":41,"tag":236,"props":444,"children":445},{},[446],{"type":41,"tag":54,"props":447,"children":448},{},[449],{"type":47,"value":450},"R²",{"type":41,"tag":236,"props":452,"children":453},{},[454],{"type":47,"value":455},"Proportion of variance explained — increases with degree, so compare by AIC not raw R²",{"type":41,"tag":209,"props":457,"children":458},{},[459,467],{"type":41,"tag":236,"props":460,"children":461},{},[462],{"type":41,"tag":54,"props":463,"children":464},{},[465],{"type":47,"value":466},"AIC / BIC",{"type":41,"tag":236,"props":468,"children":469},{},[470],{"type":47,"value":471},"Penalized fit measure — lower is better; use to choose degree without overfitting",{"type":41,"tag":209,"props":473,"children":474},{},[475,483],{"type":41,"tag":236,"props":476,"children":477},{},[478],{"type":41,"tag":54,"props":479,"children":480},{},[481],{"type":47,"value":482},"Confidence band",{"type":41,"tag":236,"props":484,"children":485},{},[486],{"type":47,"value":487},"Range of plausible mean y values at each x — widens toward the edges of the data",{"type":41,"tag":209,"props":489,"children":490},{},[491,499],{"type":41,"tag":236,"props":492,"children":493},{},[494],{"type":41,"tag":54,"props":495,"children":496},{},[497],{"type":47,"value":498},"Prediction interval",{"type":41,"tag":236,"props":500,"children":501},{},[502],{"type":47,"value":503},"Range for a new individual observation — always wider than confidence band",{"type":41,"tag":209,"props":505,"children":506},{},[507,515],{"type":41,"tag":236,"props":508,"children":509},{},[510],{"type":41,"tag":54,"props":511,"children":512},{},[513],{"type":47,"value":514},"Residual plot",{"type":41,"tag":236,"props":516,"children":517},{},[518],{"type":47,"value":519},"Should be random scatter; systematic curvature = the degree is still too low",{"type":41,"tag":42,"props":521,"children":523},{"id":522},"example-prompts",[524],{"type":47,"value":525},"Example Prompts",{"type":41,"tag":201,"props":527,"children":528},{},[529,545],{"type":41,"tag":205,"props":530,"children":531},{},[532],{"type":41,"tag":209,"props":533,"children":534},{},[535,540],{"type":41,"tag":213,"props":536,"children":537},{},[538],{"type":47,"value":539},"Scenario",{"type":41,"tag":213,"props":541,"children":542},{},[543],{"type":47,"value":544},"What to type",{"type":41,"tag":229,"props":546,"children":547},{},[548,565,582,599,616,633],{"type":41,"tag":209,"props":549,"children":550},{},[551,556],{"type":41,"tag":236,"props":552,"children":553},{},[554],{"type":47,"value":555},"Choose best degree",{"type":41,"tag":236,"props":557,"children":558},{},[559],{"type":41,"tag":240,"props":560,"children":562},{"className":561},[],[563],{"type":47,"value":564},"fit polynomial degrees 1–4 to data; compare R² and AIC; plot best degree with confidence band",{"type":41,"tag":209,"props":566,"children":567},{},[568,573],{"type":41,"tag":236,"props":569,"children":570},{},[571],{"type":47,"value":572},"Quadratic with vertex",{"type":41,"tag":236,"props":574,"children":575},{},[576],{"type":41,"tag":240,"props":577,"children":579},{"className":578},[],[580],{"type":47,"value":581},"quadratic regression of y on x; report vertex (x at minimum/maximum); 95% CI on vertex location",{"type":41,"tag":209,"props":583,"children":584},{},[585,590],{"type":41,"tag":236,"props":586,"children":587},{},[588],{"type":47,"value":589},"Centered polynomial",{"type":41,"tag":236,"props":591,"children":592},{},[593],{"type":41,"tag":240,"props":594,"children":596},{"className":595},[],[597],{"type":47,"value":598},"fit degree-2 polynomial; center x at its mean before squaring to reduce multicollinearity; report coefficients",{"type":41,"tag":209,"props":600,"children":601},{},[602,607],{"type":41,"tag":236,"props":603,"children":604},{},[605],{"type":47,"value":606},"Group comparison",{"type":41,"tag":236,"props":608,"children":609},{},[610],{"type":41,"tag":240,"props":611,"children":613},{"className":612},[],[614],{"type":47,"value":615},"fit quadratic for each group in 'gender' column; overlay on one plot; compare curvature coefficients",{"type":41,"tag":209,"props":617,"children":618},{},[619,624],{"type":41,"tag":236,"props":620,"children":621},{},[622],{"type":47,"value":623},"Extrapolation warning",{"type":41,"tag":236,"props":625,"children":626},{},[627],{"type":41,"tag":240,"props":628,"children":630},{"className":629},[],[631],{"type":47,"value":632},"fit cubic regression; plot fit; shade the extrapolation region outside the training data range",{"type":41,"tag":209,"props":634,"children":635},{},[636,641],{"type":41,"tag":236,"props":637,"children":638},{},[639],{"type":47,"value":640},"Full inference",{"type":41,"tag":236,"props":642,"children":643},{},[644],{"type":41,"tag":240,"props":645,"children":647},{"className":646},[],[648],{"type":47,"value":649},"polynomial regression degree 2; ANOVA table; F-test for the quadratic term; standardized coefficients",{"type":41,"tag":42,"props":651,"children":653},{"id":652},"assumptions-to-check",[654],{"type":47,"value":655},"Assumptions to Check",{"type":41,"tag":657,"props":658,"children":659},"ul",{},[660,670,680,690,700],{"type":41,"tag":133,"props":661,"children":662},{},[663,668],{"type":41,"tag":54,"props":664,"children":665},{},[666],{"type":47,"value":667},"Representative x range",{"type":47,"value":669}," — polynomial fits extrapolate wildly outside the data range; never use a polynomial for prediction beyond the observed x values",{"type":41,"tag":133,"props":671,"children":672},{},[673,678],{"type":41,"tag":54,"props":674,"children":675},{},[676],{"type":47,"value":677},"No overfitting",{"type":47,"value":679}," — adding more terms always increases R², but high-degree polynomials oscillate between data points (Runge's phenomenon); use AIC/BIC or cross-validation to select degree, not raw R²",{"type":41,"tag":133,"props":681,"children":682},{},[683,688],{"type":41,"tag":54,"props":684,"children":685},{},[686],{"type":47,"value":687},"Residual normality and homoscedasticity",{"type":47,"value":689}," — the same assumptions as linear regression: residuals should be approximately normal with constant variance across x",{"type":41,"tag":133,"props":691,"children":692},{},[693,698],{"type":41,"tag":54,"props":694,"children":695},{},[696],{"type":47,"value":697},"Multicollinearity between powers",{"type":47,"value":699}," — x and x² are correlated, which inflates coefficient standard errors; centering x (subtracting the mean) before fitting substantially reduces this",{"type":41,"tag":133,"props":701,"children":702},{},[703,708],{"type":41,"tag":54,"props":704,"children":705},{},[706],{"type":47,"value":707},"Sufficient data",{"type":47,"value":709}," — a degree-n polynomial has n+1 parameters; you need at least 5–10 observations per coefficient for stable estimation",{"type":41,"tag":42,"props":711,"children":713},{"id":712},"related-tools",[714],{"type":47,"value":715},"Related Tools",{"type":41,"tag":50,"props":717,"children":718},{},[719,721,727,729,735,737,743],{"type":47,"value":720},"Use the ",{"type":41,"tag":170,"props":722,"children":724},{"href":723},"/tools/linear-regression",[725],{"type":47,"value":726},"Linear Regression tool",{"type":47,"value":728}," when the relationship is straight (degree 1) — it provides the same output more simply. Use the ",{"type":41,"tag":170,"props":730,"children":732},{"href":731},"/tools/multiple-regression",[733],{"type":47,"value":734},"Multiple Regression tool",{"type":47,"value":736}," when you have several predictors; polynomial regression of x is equivalent to multiple regression with x, x², x³ as separate predictors. Use the ",{"type":41,"tag":170,"props":738,"children":740},{"href":739},"/tools/residual-plot",[741],{"type":47,"value":742},"Residual Plot Generator",{"type":47,"value":744}," after fitting to check whether curvature remains in the residuals, which indicates the chosen degree is insufficient.",{"type":41,"tag":42,"props":746,"children":748},{"id":747},"frequently-asked-questions",[749],{"type":47,"value":750},"Frequently Asked Questions",{"type":41,"tag":50,"props":752,"children":753},{},[754,759,761,766,768,773,775,780,782,787],{"type":41,"tag":54,"props":755,"children":756},{},[757],{"type":47,"value":758},"How do I choose the right polynomial degree?",{"type":47,"value":760},"\nThe best approach is model comparison by ",{"type":41,"tag":54,"props":762,"children":763},{},[764],{"type":47,"value":765},"AIC",{"type":47,"value":767}," (Akaike Information Criterion) or ",{"type":41,"tag":54,"props":769,"children":770},{},[771],{"type":47,"value":772},"BIC",{"type":47,"value":774},": fit degrees 1 through (say) 5, compute AIC for each, and choose the degree with the lowest AIC. AIC penalizes extra parameters, preventing overfitting. Alternatively, use ",{"type":41,"tag":54,"props":776,"children":777},{},[778],{"type":47,"value":779},"cross-validation",{"type":47,"value":781},": split the data into training and test sets, fit each degree on training, evaluate prediction error on test. Never use R² alone — it always increases with degree. Ask the AI to ",{"type":41,"tag":154,"props":783,"children":784},{},[785],{"type":47,"value":786},"\"fit degrees 1–5 and plot AIC vs degree to identify the elbow\"",{"type":47,"value":788},".",{"type":41,"tag":50,"props":790,"children":791},{},[792,797,799,803,805,810,812,817,819,824,826,831],{"type":41,"tag":54,"props":793,"children":794},{},[795],{"type":47,"value":796},"What is the difference between polynomial regression and spline regression?",{"type":47,"value":798},"\nBoth model curves, but differently. ",{"type":41,"tag":54,"props":800,"children":801},{},[802],{"type":47,"value":58},{"type":47,"value":804}," uses a single global polynomial across all x values — it can oscillate wildly at the edges. ",{"type":41,"tag":54,"props":806,"children":807},{},[808],{"type":47,"value":809},"Spline regression",{"type":47,"value":811}," (or generalized additive models) joins several lower-degree polynomials at ",{"type":41,"tag":54,"props":813,"children":814},{},[815],{"type":47,"value":816},"knot points",{"type":47,"value":818},", producing a smooth but locally flexible curve that doesn't oscillate. For datasets with many observations and complex shapes, splines are generally preferred. Ask the AI to fit a ",{"type":41,"tag":54,"props":820,"children":821},{},[822],{"type":47,"value":823},"cubic spline",{"type":47,"value":825}," or use ",{"type":41,"tag":54,"props":827,"children":828},{},[829],{"type":47,"value":830},"LOWESS smoothing",{"type":47,"value":832}," as alternatives to high-degree polynomials.",{"type":41,"tag":50,"props":834,"children":835},{},[836,841],{"type":41,"tag":54,"props":837,"children":838},{},[839],{"type":47,"value":840},"My quadratic coefficient is not statistically significant — should I drop it?",{"type":47,"value":842},"\nIf the F-test for the quadratic term (β₂) is not significant (p > 0.05), the data doesn't support curvature at the current sample size. In that case, drop to degree 1 (linear regression). However, be cautious: insufficient statistical power (small n) can mask real curvature. If the residual plot from a linear fit shows a systematic arch, fit the quadratic regardless of p-value and report both models.",{"type":41,"tag":50,"props":844,"children":845},{},[846,851,853,858,860,865],{"type":41,"tag":54,"props":847,"children":848},{},[849],{"type":47,"value":850},"Can I fit a polynomial with multiple predictor variables?",{"type":47,"value":852},"\nYes — this produces ",{"type":41,"tag":54,"props":854,"children":855},{},[856],{"type":47,"value":857},"polynomial features",{"type":47,"value":859}," in multiple dimensions. For two predictors x₁ and x₂, a degree-2 model includes x₁, x₂, x₁², x₂², and the interaction x₁×x₂. Ask the AI to ",{"type":41,"tag":154,"props":861,"children":862},{},[863],{"type":47,"value":864},"\"fit degree-2 polynomial regression with predictors 'temperature' and 'humidity'; include all interaction and squared terms; report which terms are significant\"",{"type":47,"value":866},". This quickly becomes parameter-heavy, so ensure sufficient data.",{"type":41,"tag":50,"props":868,"children":869},{},[870,875,877,882,884,889,891,896],{"type":41,"tag":54,"props":871,"children":872},{},[873],{"type":47,"value":874},"What does the confidence band represent and why does it widen at the edges?",{"type":47,"value":876},"\nThe ",{"type":41,"tag":54,"props":878,"children":879},{},[880],{"type":47,"value":881},"confidence band",{"type":47,"value":883}," shows the uncertainty in the ",{"type":41,"tag":154,"props":885,"children":886},{},[887],{"type":47,"value":888},"mean",{"type":47,"value":890}," predicted y at each x value. It is narrowest near the center of the data (where the model is best anchored) and widens at the edges because the polynomial is less constrained there — small changes in coefficients have large effects on the curve away from the centroid. The ",{"type":41,"tag":54,"props":892,"children":893},{},[894],{"type":47,"value":895},"prediction interval",{"type":47,"value":897}," (wider still) adds residual scatter and represents where a new individual observation is expected to fall.",{"title":7,"searchDepth":899,"depth":899,"links":900},2,[901,902,903,904,905,906,907,908],{"id":44,"depth":899,"text":48},{"id":124,"depth":899,"text":127},{"id":196,"depth":899,"text":199},{"id":366,"depth":899,"text":369},{"id":522,"depth":899,"text":525},{"id":652,"depth":899,"text":655},{"id":712,"depth":899,"text":715},{"id":747,"depth":899,"text":750},"markdown","content:tools:046.polynomial-regression.md","content","tools/046.polynomial-regression.md","tools/046.polynomial-regression","md",{"loc":4},1775502471791]