I am trying to test two generalized Lorenz curves using the rtip
package. Please see the code below.
library(rtip)
X = data.frame(ipuc = rchisq(20, 5))
Y = data.frame(ipuc = rchisq(20, 5))
testGL(X, Y, ipuc = "ipuc", hhcsw = NULL,
hhsize = NULL, generalized = TRUE, alpha = 0.05)
But I got the error message saying Error in dataset1[, hhcsw] : incorrect number of dimensions.
The following code is from the rtip
user manual. This is working fine.
library(rtip)
data(eusilc2)
ATdataset1 <- setupDataset(eusilc2, country = "AT", region = "Burgenland")
ATdataset2 <- setupDataset(eusilc2, country = "AT", region = "Carinthia")
testGL(ATdataset1, ATdataset2, generalized = TRUE, samplesize = 10, alpha = 0.05)
I am unsure how to resolve this issue and properly structure the data frame for the simulated data. I would greatly appreciate any advice you could provide.