Generalized Linear Models Flashcards
What is the objective of Generalising Linear Models?
To allow us to do regression in problems where our Yi is not normally distributed
What is the stochastic/random part of a model?
The form of the model which characterises the distribution of Yi (eg. Yi ~ N(mu(i), sigma²)
What is the structural part of the model?
A function of mu(i) which describes its relationship with the covariates (eg. mu(i) = B0 + B1X1 + B2X2 + … + BPXP)
What are the two types of model which we go over in this course?
- Poisson Model (for count outcomes)
- Binomial Model (for binary or binomial outcomes)
What is the difference between a binomial outcome and a binary outcome?
Binary (or Bernoulli) outcome is dependent on a single trial where as Binomial outcome is dependent on a number of trials
What is a link function?
A function which describes the relationship between the parameter of a distribution and the covariates
What is the link function for the Poisson Model?
log(lambda) = linear covariates
*natural logarithm
What is the link function for the Binomial Model?
log(odds of success) = linear covariates
*natural logarithm
Define the term “odds”?
A quantity which the the ratio of the probably of an event occurring divided by the probability of the event not occurring.
= [p(A)] / [p(not A)]
*in Bernoulli events, “A” is success and “not A” is failure
How do you read data from a CSV file into R?
data = read.csv(“filename.csv”)
What is the R function for viewing the first few rows of a data object?
head(data)
What is the R function for viewing the names of the variables in a data object?
names(data)
What is the R code for viewing the values under a specific variable name in a data object?
data$variableName
What is the R code for viewing the number of each type of value under a specific variable name in a data object?
table(data$variableName)
What is the R code for viewing the proportion of each type of value under a specific variable name in a data object?
prop.table(table(data$variableName))