![](/img/trans.png)
[英]GLM - No R-squared output when running simple linear regression with categorical predictor
[英]Matlab/R - linear regression with categorical & continuous predictors - why is the continuous predictor squared?
我正在使用分類預測變量和0到1的數字結果進行線性回歸。 在此頁面上,我看到它建議在數值預測變量與標稱符號並排時對其求平方(請參閱關於Linear Regression with Categorical Predictor
變量的Linear Regression with Categorical Predictor
第三部分)。 他們給出的示例(對於Matlab,但這也適用於R)是以下公式,其中weight
是連續的, year
是標稱的:
mdl = fitlm(tbl,'MPG ~ Year + Weight^2')
這是普遍規則嗎? 當我這樣做時,我確實得到了更強的系數,但是我想確保我不會在沒有認股權證的情況下誇大它們。 有人可以解釋使用.^
和數字一起使用數字的邏輯嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.