#--------------------------------------------------------------------------------
# Estimation of proportion in binomial distribution with 'logit' function
# 10 trials, probability of success equals to 30%)
N <- rbinom(n = 100, size = 10, prob = 0.3)
phat <- maxlogL(x = N, dist = 'dbinom', fixed = list(size=10),
link = list(over = "prob", fun = "logit_link"))
summary(phat)
# Link function name
fun <- logit_link()$name
print(fun)
# Link function
g <- logit_link()$g
curve(g(x), from = 0, to = 1)
# Inverse link function
ginv <- logit_link()$g_inv
curve(ginv(x), from = -10, to = 10)
#--------------------------------------------------------------------------------
Run the code above in your browser using DataLab