25th September, 2023

Before in general moving onto splines and other smoothing methods and applying more transforms, I wanted to continue looking at how a polynomial representation of the model would affect the fit.

Since the last time I was comparing fits just based off a polynomial for obesity, this will compare both, using just inactivity, and using inactivity and obesity together.

Inactive to degree 6 Polynomial
Inactive to degree 6 Polynomial

We see here on the basis of the P values that we actually only need up to a quadratic function.

Next I tried combining polynomials for both inactivity and obesity to see if it affected the fit in a meaningful way.

Polynomial fit for both Inactivity and Obesity
Polynomial fit for both Inactivity and Obesity

As seen here by the R square values we can tell that it was not a significant increase.

After this I tried taking log functions of the polynomials to see if that would alter my results significantly.

Log of Polynomial Functions
Log of Polynomial Functions

As we can see from the R squared values again this was not producing anything drastically different in terms of what the fit was.

To further modify things I have tried to add an interaction term and as well as taking a log of diabetes as well.

Results forr adding an interaction term as well
Results for adding an interaction term as well

As we can see from our latest test that the addition of the interaction term changed things rather significantly as compared to the previous transforms and this also helped increase the R squared value.

Leave a Reply

Your email address will not be published. Required fields are marked *