# A(H1N1)v immunity in the Finnish population

## Scope

What was the immunity to this virus before the 2009 pandemic in Finland?

## Definition

### Data

Immunity due to infections related to the early 1900s Spanish flu[1]
Age group  %-immune
65-79 15-20
80-89 57
90-100 96

### Formula

• P(immune) = P(vaccinated or base_immunity)
• Since both events are totally independent of each other: P(immune) = 1 - P(not vaccinated) * P(no base_immunity)

 ```library(OpasnetBaseUtils) # Base immunity Pop <- op_baseGetData("opasnet_base", "Op_en2949") Age <- as.factor(c("65-69","70-74","75-79","80+","All")) Immunity <- c(0.2, 0.2, 0.2, 0.6, 0) imm <- data.frame(Age,Immunity) imm <- merge(Pop, imm, all = TRUE) imm[is.na(imm\$Immunity), "Immunity"] <- 0 imm[imm\$Age=="All", "Immunity"] <- sum(imm[1:17,4]*imm[1:17,5])/imm[18,4] colnames(imm)[5] <- "Freq" imm[,c(1,5)] #op_baseWrite("opasnet_base", imm[,c(1,5)]) # Total immunity P(imm) = P(vac or base_imm) imm <- function(ibimm = op_baseGetData("opasnet_base", "Op_en4943", series_id = 994)[,-1], ivac_cov = op_baseGetData("opasnet_base", "Op_en4925")[,-1]) { colnames(ibimm)[ncol(ibimm)] <- "ibimm" colnames(ivac_cov)[ncol(ivac_cov)] <- "ivac_cov" out <- merge(ibimm, ivac_cov) out <- model.frame(I(1 - (1 - ibimm) * (1 - ivac_cov)) ~., data = out) colnames(out)[1] <- "Result" return(out) } imm() #op_baseWrite("opasnet_base", imm()) ```