I am unable to perform annova on a linear regression model. I have attached the simplified code below. Please let me know how to fix it.
import statsmodels.api as sm
import numpy as np
# define the data
x1 = np.random.rand(100)
x2 = np.random.rand(100)
y = 2*x1 + 3*x2 + np.random.normal(size=100)
# build the model with all independent variables
X = sm.add_constant(np.column_stack((x1, x2)))
model = sm.OLS(y, X).fit()
# perform the F-test
f_value, p_value, _ = sm.stats.anova_lm(model, typ=1)