# simple estimation on iris data, clustering by "Species"
res_poisson = femlm(Sepal.Length ~ Sepal.Width + Petal.Length +
Petal.Width | Species, iris)
# we extract the fitted values
y_fitted_poisson = fitted(res_poisson)
# Same estimation but in OLS (Gaussian family)
res_gaussian = femlm(Sepal.Length ~ Sepal.Width + Petal.Length +
Petal.Width | Species, iris, family = "gaussian")
y_fitted_gaussian = fitted(res_gaussian)
# comparison of the fit for the two families
plot(iris$Sepal.Length, y_fitted_poisson)
points(iris$Sepal.Length, y_fitted_gaussian, col = 2, pch = 2)
Run the code above in your browser using DataLab