SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: Question about outcome equation when independent unobserved [ Reply ]
By: Ott Toomet on 2012-11-28 20:22
[forum:36987]
Dear Kamontip,
can you please give me an example which exactly replicates your problem?
* Currently, your code is a little hard to understand, and several values are not there, so I don't want to do all the guessing to be able to run it.
* What do you mean that your latent independent variable is not observable? I would say you should either use observable variables, or estimate the latent traits using e.g. factor analysis. But I know too little about what you intend to do.

Best,
Ott

Question about outcome equation when independent unobserved [ Reply ]
By: kamontip srihaset on 2012-11-28 14:57
[forum:36955]
I generate complete data under Item Response Theory model (3-PL model). Then, I treat missing data depent on motivation variable;
##### generate response data (3PL model)
p<-matrix(nrow=n,ncol=I)
y<-matrix(nrow=n,ncol=I)
for (i in 1:n)
{
for (j in 1:I)
{
p[i,j]<-c[j]+(1-c[j])/(1+exp(-1.7*a[j]*(theta[i]-b[j])))
u<-runif(1,0,1)
y[i,j]<-ifelse(u<=p[i,j],2,1)
}
}
data<-data.frame(y,theta,mov)
data.sort<-data[order(data$mov),]
theta.sort<-data.sort$theta
y.sort<-data.sort[1:I]
##### generate missing pattern (y1) ####
mov.low<-data.sort$mov<mean(mov)
num.mov.low<-table(mov.low)[1]
y1.miss.low<-y.sort[1:num.mov.low,1]
nonmiss.pattern<-rbinom(length(y1.miss),1,1-p.missing)
y1.miss.low<-y1.miss.low*nonmiss.pattern
for(i in 1:num.mov.low)
{
ifelse(y1.miss.low[i]==0,y1.miss.low[i]<-NA,y1.miss.low[i]<-y1.miss.low[i])
}
y.miss<-y.sort
y.miss[1:num.mov.low,1]<-y1.miss.low
y.miss<-y.miss-1
y.miss<-data.frame(y.miss)
I have problem about outcome equation in Sample Seletion model becuase in this equation my independent variable (latent trait) can not observe. Could
you please tell me how to solve this my problem.
Thank you very much,
Kamontip

Thanks to:
Vienna University of Economics and Business Powered By FusionForge