Skip to content
Back to formatted view

Raw Message

Message-ID: <1085570E-FFA4-4F30-9587-D2F610181F4C@gmail.com>
Date: 2016-03-03T18:30:16Z
From: Alaa Sindi
Subject: estimate likelihood

Hi all,

Is it possible to estimate the likelihood parameter and test for significant as follows:

x <- c(1.6, 1.7, 1.7, 1.7, 1.8, 1.8, 1.8, 1.8)
y <- c( 6, 13, 18, 28, 52, 53, 61, 60)
n <- c(59, 60, 62, 56, 63, 59, 62, 60)

# note: there is no need to have the choose(n, y) term in the likelihood
fn <- function(p)


z = p[1]+p[2]*x
sum( - (y*z) - n*log(1+exp(z*x))) 

out <- nlm(fn, p = c(-50,20), hessian = TRUE, print.level=2)

out

eigen(out$hessian)
sqrt(diag(solve(out$hessian)))


Thanks