File: logisticpost.Rd

package info (click to toggle)
r-cran-learnbayes 2.15.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,864 kB
  • sloc: sh: 15; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 766 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
\name{logisticpost}
\alias{logisticpost}
\title{Log posterior for a binary response model with a logistic link and a uniform prior}
\description{
 Computes the log posterior density of (beta0, beta1)  when
yi are independent binomial(ni, pi) and logit(pi)=beta0+beta1*xi and
a uniform prior is placed on (beta0, beta1)
}
\usage{
logisticpost(beta,data)
}
\arguments{
  \item{beta}{vector of parameter values beta0 and beta1}
  \item{data}{matrix of columns of covariate values x, sample sizes n, and number of successes y}
}

\value{
value of the log posterior
}

\author{Jim Albert}

\examples{
x = c(-0.86,-0.3,-0.05,0.73)
n = c(5,5,5,5)
y = c(0,1,3,5)
data = cbind(x, n, y)
beta=c(2,10)
logisticpost(beta,data)
}

\keyword{models}