-- Helios de Rosario Mart?nez Researcher
El d?a 22/02/2012 a las 11:32, Florian Weiler <fweiler08 at jhubc.it>
escribi?:
Dear all, I have a (probably very basic) question. I am imputing data with the
mice
package, using 10 chains. I can then write out the 10 final values of
the
chains simply by
name1 <- complete(imp, 1)
:
:
name10 <- complete(imp,10)
Not a big deal, I just wanted to do that in a little loop as
follows:
for (i in 1:10){
set[i] <- complete(imp,i)}
Yet that doesn't work, I also tried other things like:
for (i in 1:10){
set[[i]] <- complete(imp,i)}
Again, no success. It only saves a couple of lines of code, but there
must
be an easy solution, right? Thanks, Florian
Hi Florian,
Please give more context. There are various reasons why that could
fail. Is your list "set" defined before starting to assign values?
Try:
set <- vector("list",10)
before the loop.
INSTITUTO DE BIOMEC?NICA DE VALENCIA
Universidad Polit?cnica de Valencia ? Edificio 9C
Camino de Vera s/n ? 46022 VALENCIA (ESPA?A)
Tel. +34 96 387 91 60 ? Fax +34 96 387 91 69
www.ibv.org
Antes de imprimir este e-mail piense bien si es necesario hacerlo.
En cumplimiento de la Ley Org?nica 15/1999 reguladora de la Protecci?n
de Datos de Car?cter Personal, le informamos de que el presente mensaje
contiene informaci?n confidencial, siendo para uso exclusivo del
destinatario arriba indicado. En caso de no ser usted el destinatario
del mismo le informamos que su recepci?n no le autoriza a su divulgaci?n
o reproducci?n por cualquier medio, debiendo destruirlo de inmediato,
rog?ndole lo notifique al remitente.