Message-ID: <VI1PR05MB331253C486F41F4ADF0C01E1F36A0@VI1PR05MB3312.eurprd05.prod.outlook.com>
Date: 2018-05-24T14:46:50Z
From: Ioanna Ioannou
Subject: Manipulation of data.frame into an array
Hello everyone,
I want to transform a data.frame into an array (lets call it mydata), where: mydata[[1]] is the first imputed dataset...and for each mydata[[d]], the first p columns are covariates X, and the last one is the outcome Y.
Lets assume a simple data.frame:
Imputed = data.frame( X1 = c(1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2),
X2 = c(0,1,0,1,1,1,0,1, 0,1,0,1,1,1,0,1),
Y = c(1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8))
The first 8 have been obtained by the first imputation and the later 8 by the 2nd.
Can you help me please?
Best,
ioanna
[[alternative HTML version deleted]]