1
$\begingroup$

I am trying to identify what attributes are not relevant in my dataset to remove them before fitting a classifier.

The target is a categorical variable with three different values.

I also have a lot of numerical attributes.

For ANOVA, I used the following code:

grouped_test2=df[['room_type', 'price']].groupby(['room_type'])
f_val, p_val = stats.f_oneway(grouped_test2.get_group('Entire home/apt')['price'], grouped_test2.get_group('Private room')['price'], grouped_test2.get_group('Shared room')['price'])  

The independent variable is room_type, and the explanatory variable is price.

In this case, the f_val is equal to 1061.64 and p_val is equal to 0.

I read that 0 or values near 0 imply a relationship between the two variables but I am not sure about that?

What mean f_val is near enough to 0 to can say that the two variables are related?

$\endgroup$
1
$\begingroup$

f_val is the F Statistic value. Mathematically it is

$ F = \frac{MS_{Between}}{MS_{Within}}$

The null hypothesis for your ANOVA is

$H_0: \mu_{Entire home/apt} = \mu_{Private room} = \mu_{Shared room} $ which means all means ($\mu_i$ s) are equal and there is no need of grouping using explanatory variable

vs

$H_A:$ At least one $\mu_i$ is different. There is a need for grouping

The p-value for this test was very very low, hence python returned 0. Anything less than 0.05 is considered low enough to reject the null hypothesis.

Independent variables are also called explanatory variables. I believe price is a dependent variable.

$\endgroup$
  • $\begingroup$ So null hipotesis is H_0, and if a this is rejected there are any relation between the variables right? so really for know if thre are any relation F value is not need right? $\endgroup$ – Tlaloc-ES Nov 9 '19 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.