The wild broccoli 🥦

Current mood: feeling The current mood of oleracea at www.imood.com

I am free

Mood: 🤓 academic


This week I had another exam, this time in epidemiology. I find the epidemiology course both easy and difficult because I have just enough background knowledge to know the concepts but also have historically used them differently in extremely specific contexts so my intuition can end up being wrong.

Neocities continues to give me 503 errors when I use the CLI to upload my site, so I cannot really recommend using my little batch file for your site. I have upgraded my site to supporter status in hopes that they will start replying to my emails but so far I have received no emails. Well, if I can’t upload files to my site I guess there is alwys the option to use Nekoweb instead!

In another class this week we have finally moved on to the generalized linear model. It seems a little more complicated to fit them in R than it is in Stata, which has individual commands for each common family. But I like R’s flexibility as well.

When fitting a GLM in R, use the function glm(fomula, family = family(link = function), data=data)

Family Default link function Other potential link functions
binomial (link=“logit”) “probit”, “log”, “cloglog”
gaussian (link=“identity”) “log”, “inverse”
gamma (link=“inverse”) “identity”, “log”
poisson (link=“log”) “identity”, “sqrt”
inverse gaussian (link=“1/mu^2”) “inverse”, “identity”, “log”

Note that when you want the log-odds ratio you have to use the exponent of \(\hat{\beta}\) to find the odds ratio, and when you calculate the 95% confidence intervals, the lower and upper bounds will be \( \text{exp}(\hat\beta \pm 1.96 \times SE(\hat\beta)) \). Why 1.96? Because that is the critical value from the standard normal distrubution corresponding to 0.95: \( P(-1.96 < Z < 1.96) = 0.95 \). If you want a different confidence interval, then just use a different value from the standard normal distribution. In R, you can do this by using the function qnorm(p=alpha/2, lower.tail = FALSE)


Well, that’s what I learned in class today! By the way, here is how Stata computes standard errors and confidence intervals for odds ratios in logistic regression, which seems to be the same method as we’ve learned: Delta rule. So I’m glad that I wasn’t secretly making a mistake this whole time.

#Blog #Statistics