Displaying 4 results from an estimated 4 matches for "ymis".
Did you mean:
nmis
2007 Jul 12
1
mix package causes R to crash
...I supplied was a fake dataset.
################################################################
library(mix)
n <-100
x1<-rnorm(n)
x2<-rnorm(n,2,1.2)
x3<-rnorm(n,1,2)
x4<-floor(rnorm(n)*3)
y <-rnorm(n,1*x1+2*x2+3*x3+4*x4,2)
w <-rnorm(n,3,1.2)
ymis<-y
ymis[floor(runif(10,1,n))]<-NA
wmis<-w
wmis[floor(runif(10,1,n))]<-NA
dat<-as.data.frame(cbind(wmis,ymis,x1,x2,x3,x4))
s <- prelim.mix(dat,3) # do preliminary manipulations
thetahat <- em.mix(s) # ML estimate for unrestricted model
rngseed...
2005 Sep 28
1
Fast AUC computation
I am doing a simulation with a relatively large data set (20,000
observations) for which I want to calculate the area under the Receiver
Operator Curve (AUC) for many parameter combinations. I am using the ROC
library and the following commands to generate each AUC:
rocobj=rocdemo.sca(truth = ymis, data = model$fitted.values, rule =
dxrule.sca) #generation of observed ROC object
aucobj=AUC(rocobj) #pulling out just the observed AUC - trapezoidal not
integrated
but they are pretty slow.
Does anyone know of a faster way to get the AUC?
Thanks,
Nina
[[alternative HTML version d...
2005 Jul 08
2
missing data imputation
...rr/tc.csv","C:/R")
#RUN NORM
tc <- read.csv("tc.csv", header = TRUE)
rngseed(1234567) #set random number generator seed
s <- prelim.norm(tc)
thetahat <- em.norm(s) #find the MLE for a starting value
theta <- da.norm(s,thetahat,steps=20,showits=TRUE,return.ymis=TRUE) #take 20 steps
ximp <- imp.norm(s,thetahat,tc) #impute missing data under the MLE
2005 Oct 24
0
In da.norm Error: NA/NaN/Inf in foreign function call (arg 2)
...<-matrix(rnorm(n*p),nrow=n)
#create missing data
for (j in 1:p)
{miss<-rbinom(n,1,prob.miss)
for (i in 1:n){if (miss[i]==1) x[i,j]<-NA}}
#create imputations
seed<-1234
rngseed(seed)
s <- prelim.norm(x)
thetahat <- em.norm(s,showits=F)
da.norm(s,thetahat,steps=1000,showits=F,return.ymis=TRUE)