Esittely latautuu. Ole hyvä ja odota

Esittely latautuu. Ole hyvä ja odota

Probability models and decision analysis

Samankaltaiset esitykset


Esitys aiheesta: "Probability models and decision analysis"— Esityksen transkriptio:

1 Probability models and decision analysis
Logistic regression Probability models and decision analysis Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi

2 Inference about proportions
Think of a population, where the proportion of females is q. If you sample a random individual from the population, it is a female with probabiliy q If the individual is returned into the population, then the probability that the next sampled individual is a female is also q If the sampled individuals are not returned, then the next individual is a female with probability P(female )=(N*q-f)/(N-f-m), where N:population size,f:females seen so far, m: males seen so far Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi

3 Number of females in a sample?
Probability to observe 1 female out of 2 sampled individuals (with replacement) = 2*q*(1-q) Probability to observe 1 female out of 3: =3*q*(1-q)*(1-q) Probability to observe 2 females out of 3: =3*q*q*(1-q) Probability to observe x females out of N sampled: = Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi

4 Binomial distribution
In other words, the number of females x observed in a sample of size N follows a binomial distribution, given that the proportion q is known: x~Bin(N,q) Typical situation: q is not known, and we would like to estimate it N samples are taken, and x becomes observed When q is assumed to depend on some factor, then we can use logistic regression Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi

5 Logistic function Proportion q must always lie between 0 and 1
->Linear regression does not work Simple approach: linear regression for a transformation of q Logistic transformation: Ln(q/(1-q))=z or logit(q)=z q=exp(z)/(1+exp(z)) Then use a linear regression model for z Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi

6 logit-transformation
Original scale ”logit-scale” Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi

7 Logistic regression q depends on variable x logit(q)=a+b*x
q=exp(a+b*x)/(1+exp(a+b*x)) Interpretation: a: intercept of logit(q) when x=0 b: slope of the regression on logit(q) -a/b: value of x when q=0.5 Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi

8 Logistic regression in BUGS
Number of groups model{ for(i in 1:n){ y[i]~dbin(q[i],N[i]) logit(q[i])<-a+b*x[i] } a~dnorm(?,?) b~dnorm(?,?) Number of samples in group i Number of ”successes” in group i True proportion in group i y[] N[] x[] 30 4 12 10 END Logistic regression model Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi

9 ”Random effects” logistic regression in BUGS
Random variation between the proportions in different groups model{ for(i in 1:n){ y[i]~dbin(q[i],N[i]) logit(q[i])<-z[i] z[i]~dnorm(mu[i],tau) mu[i]<-a+b*x[i] } a~dnorm(?,?) b~dnorm(?,?) tau<-1/pow(sd,2) sd~dnorm(?,?)I(0,) y[] N[] x[] 30 4 12 10 END Prior for the amount of random variation Between groups Biotieteellinen tiedekunta / Henkilön nimi / Esityksen nimi


Lataa ppt "Probability models and decision analysis"

Samankaltaiset esitykset


Iklan oleh Google