-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel2.r
More file actions
32 lines (24 loc) · 658 Bytes
/
Copy pathmodel2.r
File metadata and controls
32 lines (24 loc) · 658 Bytes
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
cat("model{
for(i in 1:n){
y[i]~dbin(pi[i],1)
#Funcion Liga
logit(pi[i])<-alpha+x[i,]%*%beta
}
#A priori's
alpha ~ dnorm(0,1.0E-6)
tau ~ dgamma(1.0E-4,1.0E-4)
tauBeta <-pow(sdBeta,-2); sdBeta ~ dunif(0,20)
TauM[1] <- tauBeta*1000; TauM[2] <- tauBeta
PInd[2] <- 20/127; PInd[1] <- 1-PInd[2]
for(i in 1:var_expl){
IndA[i] ~ dcat(PInd[])
Ind [i] <- IndA[i]-1
beta[i] ~ dnorm(0, TauM[IndA[i]])
}
#Estimaciones de Ys conocidas con
#La posterior que genera Jags
for(i in 1:n){
yest[i]~dbin(pi[i],1)
}
}"
, file="ssvs_02.txt")