[R] How to repeat replication

2012-11-30 Thread Kamontip Srihaset


Dear all,

I generate data under IRT mdel. I conducted 1000 replications. When I run, some 
replication was not fit with my model. So, replications were fit model were 
less than 1000 replication. If I want its run until 1000 replicaions. How 
shouldI write functin. 

Thank you,
Kamontip



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to impute MNAR by using ML

2012-11-28 Thread Kamontip Srihaset


Dear all,

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$movmean(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



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Question about Package 'sampleSection' for IRT model

2012-11-19 Thread Kamontip Srihaset


Dear All,

I am Ph.D student at Chulalongkorn University in Thailand, I want to use 
Package 'sampleSection' to estimate missing data which generate under IRT 
model(3-PL);

n-500 ## number of examinee
I-20 ## number of items
num.imp-5 ##number of imputations
p.missing-c(0.09, 0.01) #prob of missing
theta-sort(rnorm(n,0,1)) #ability
a-rnorm(I,0.5,0.1) #discrimination
b-rnorm(I,0,1) #difficulty
c-runif(I,0,0.25) #guess
Only item 1 have missing data. If the response to items 1 was a 1 (correct), 
the probability of missingwas 1%. If the
response was a 0 (incorrect), the probability of missing was 9%. Thus, the 
probability of missing was linked to the response of items itself (an unknown 
characteristic in real missing data situations).

I don't know how to apply function 'Heckman-style selection models' for this 
case, becase all my variables are unobserved.
Could you please tell me how to estimate data under my situation.
I'am looking forward your advice.

Sincerely yours,
Kamontip Srihaset



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Question about MICE and Amelia II

2012-11-11 Thread Kamontip Srihaset


Dear all,
I am Ph.D student at Chulalongkorn University in Thailand, I use package 'MICE' 
and 'Amelia II' to impute missing data assump MAR and MNAR. I don't have 
problem to impute under MAR, but I don't know how to impute MNAR. My MNAR data 
generate under IRT model(3-PL);
n-500 ## number of examinee
I-20 ## number of items
num.imp-5 ##number of imputations
p.missing-c(0.09, 0.01) #prob of missing
theta-sort(rnorm(n,0,1)) #ability
a-rnorm(I,0.5,0.1) #discrimination
b-rnorm(I,0,1) #difficulty
c-runif(I,0,0.25) #guess
Only item 1-4 have missing data. If the response to each items was a 1 
(correct), the probability of missing for each items was 1%. If the
response was a 0 (incorrect), the probability of missing was 9%. Thus, the 
probability of missing each items was linked to the response of each items 
itself (an unknown characteristic in real missing data situations).
Could you please tell me function or how to impute data under my situation.
I'am looking forward you sugtion.

Sincerely yours,
Kamontip Srihaset




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Package of EM and MI for IRT in R

2012-06-18 Thread Kamontip Srihaset


Dear all members,

I am Phd. candidate student at Chulalongkorn U., Thailand. I am interested in 
expectation maximization algorithm (EM) and multiple imputation (MI) for 
imputation missing values(missing at random(MAR) and missing not at random 
(MNAR)) in IRT (3-PL). So, I want to know about package in R or function of EM 
and MI for simulate this problem

I am looking forward your answer.

sincerely yours,

Kamontip Srihaset



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.