I'm trying to model Mean Opinion Scores (MOS) about image quality, based on an image data base. The data base has 3000 images, it has 25 original images, 24 distortions of each one and 5 levels of distortion for each distortion type (25*24*5 = 3000). The MOS is a real number between 0 and 9.
The MOS distribution doesn't seem to be normal since according to its histogram it is not symmetric.
I think a Beta distribution would be fine, since it is negative skew. Do you agree with me? What other distribution could be used?
What confuses me is that the explanatory variables are categorical,
Image: it is a number in the range 1, 2, ... up to 25
Distortion: it is a number in the range 1, 2, ... up to 24
Level: it is a number in the range 1, 2, ... up to 5
I'm not sure how to work with categorical variables in a General Linear Model.
I don't know what link function use and why neither.
I wrote this code in python to fit the model:
# the data were previously loaded in a numpy array called data_array
X = np.empty((3000, 3))
X[:,0] = data_array[:, 0].astype(int) # image
X[:,1] = data_array[:, 1].astype(int) # distortion
X[:,2] = data_array[:, 2].astype(int) # level
mos = data_array[:, 3] # mos
X = sm.add_constant(X, prepend=False) # it appends a column of 1's
model = sm.GLM(mos, X, family=sm.families.Gamma())
results = model.fit()
print(results.summary())
I used a Gamma distribution because Beta distribution is not available in Python... do you know how to get a Beta distribution from another distribution?... or maybe I should try with R not Python...
Any kind of help is welcome.
Thanks you very much!
Best regards
Lucy