필터 지우기
필터 지우기

Transformation of variables in regression

조회 수: 4 (최근 30일)
hdiba
hdiba 2016년 11월 11일
답변: Ahmet Cecen 2016년 11월 11일
Hi everybody, I have a question on multiple linear regression. I'd like to check several transformations of my independent variables (for example 1/x, x^2, sqrt(x)) in order to get a better adjusted r2. i have 5 independent variables (x1, x2, x3, x4, x5) and i would like to check the impact of different transformations at the same time. for example, one possibility would be y=1/x1+x2*x2+x3*x3+sqrt(x4)+1/x5.
in the end, the output would be the best fitted model.(crieterion=adjr2) can anyone help? thanks a lot

답변 (1개)

Ahmet Cecen
Ahmet Cecen 2016년 11월 11일
You can use my MultiPolyRegress.
Now this deviates from your parameters a little.
1) The code is limited to standard polynomial bases with minor modifications. But you can use 90% of the code with some manipulation for other transformations as well.
2) The code doesn't calculate adjusted R square, but calculates Leave One Out Cross Validated metrics automatically. You can use it for overfitting detection by comparing how close the RSquare is to CV_RSquare (closer the better).

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by