Generalised Linear Model help Kind of new to coding using Rstudio here. 
I have data for a survey for 600 individuals, over 4 years (150 p/year), for 30 categories being an absence or presence (0/1) resulting in a total score /30 for each individual child, representing their knowledge regarding a particular topic.
I am trying to measure the effects of gender, school, age and year on the total score. The distribution of scores is non-normal as you would expect, so I know a glm is required to test the significance of these independent variables.
I was wondering what family and transformations I would need to use, and would these variables require accounting for any interactions?
The end results I need are : Does the total score increase annually? Does gender have an effect on total score? Does age have an effect on the total score? Does the school the child is from have an effect on the total score?
Or can I simply test these as separate models?
Explanations would help a lot! Thank you!
My dataset is called "Framework1" with columns "Year" "Gender" "Age" "School" and "TotalScore"
 A: Your response score does not follow any generalized linear model family distribution. If the 30 categories that make up the score were statistically independent and of equal difficulty, then the score would follow a binomial distribution but, as it is, neither of these things is true. In particular it appears that the categories vary considerably in difficulty. Some are very easy so that every child gets at least one category correct. Others are so hard that no child scores higher than 23 out of 30.
This heterogeneity between the categories causes the mean-variance relationship in the scores to be different from and more complex than that assumed by the binomial glm family.
On the other hand, the scores appear to have a good range from 1 to 23. Judging from the bar chart shown, the distribution appears to be roughly bell-shaped and only slightly right skew. In my opinion, you have little to lose from simply treating the response scores as normally distributed and conducting an ordinary linear regression. There is no need to transform the response. The sample size of 600 is large enough for standard linear regression t-tests and F-tests to be robust against non-normality.
Given that you have only a few potential explanatory variables, it would be usual practice to include all them in a single additive linear regression model, then to remove the terms that are not significant (backward elimination).
It is unlikely to be productive to try to include every possible interaction term in the regression.
I would be inclined to include interaction terms only where you have some prior reason, based on your understanding of the children's behaviour and of the context, that the effect of one variable on the score might vary substantially depending on the value of another.
For example, would gender make a difference for older children but not for younger?
The whole question of interactions becomes somewhat moot if the predictor variables don't have any significant correlation with the score.
It is always a good idea to start with some data exploration and some plots.
As a first step, I would make a plot of the score versus each of the predictor variables one at a time.
If you are concerned about possible interactions, then a two-table can help with the rows and columns corresponding to the predictor variables (suitably categorized) and the entries giving mean scores.
Another more visual way to explore interactions is to use the coplot function in R, which makes a series of plots for the response versus one x-variable while varying the level of another x-variable.
