You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Categorical (as opposed to numeric) variables are ubiquitous in data analysis and linear regression, but they seem not to be supported by Statsample::Regression.
Here is an example of what I mean:
We see that lm regards the variable "ethnicity" as a categorical variable and fits a model accordingly. We can see in the output that in this case it takes ethnicity "black" as the base level, and that all other ethnicities have a statistically significant effect on "salary" (with p-values of 1e-6 or smaller) when compared to the base level.
When I try to analyse the same data in Statsample:
Categorical (as opposed to numeric) variables are ubiquitous in data analysis and linear regression, but they seem not to be supported by
Statsample::Regression
.Here is an example of what I mean:
In R, I can do:
We see that
lm
regards the variable "ethnicity" as a categorical variable and fits a model accordingly. We can see in the output that in this case it takes ethnicity "black" as the base level, and that all other ethnicities have a statistically significant effect on "salary" (with p-values of 1e-6 or smaller) when compared to the base level.When I try to analyse the same data in Statsample:
So, "NoMethodError". And when I delete "ethinicity", the model can be fit:
This issue possibly allows for a common solution with SciRuby/statsample-glm#11 and SciRuby/daru#9.
The text was updated successfully, but these errors were encountered: