Thank you for creating the hdm package. I've been working with the package to apply lasso in an instrumental variable regression with several endogenous variables as a part of my PhD thesis. I can include multiple endogenous variables with rlassoIVselectZ, but when I try the same with rlassoIVselectX, the procedure fails. From the manual it appears that I should be able to include a matrix of endogenous variables, but maybe I am misunderstanding the document. Do you know what is going on?
Here is some replicable code to show the error I am getting :
data(AJR); y = AJR$GDP; d = as.matrix(cbind.data.frame(AJR$Exprop,I(AJR$Exprop^2))); z = AJR$logMort
x = model.matrix(~ -1 + (Latitude + Latitude2 + Africa +
Asia + Namer + Samer)^2, data=AJR)
Hello,
Thank you for creating the hdm package. I've been working with the package to apply lasso in an instrumental variable regression with several endogenous variables as a part of my PhD thesis. I can include multiple endogenous variables with rlassoIVselectZ, but when I try the same with rlassoIVselectX, the procedure fails. From the manual it appears that I should be able to include a matrix of endogenous variables, but maybe I am misunderstanding the document. Do you know what is going on?
Here is some replicable code to show the error I am getting :
data(AJR); y = AJR$GDP; d = as.matrix(cbind.data.frame(AJR$Exprop,I(AJR$Exprop^2))); z = AJR$logMort x = model.matrix(~ -1 + (Latitude + Latitude2 + Africa + Asia + Namer + Samer)^2, data=AJR)
AJR.Xselect = rlassoIV(x=x, d=d, y=y, z=z, select.X=TRUE, select.Z=FALSE) AJR.Xselect = rlassoIVselectX(x=x, d=d, y=y, z=z)
Thanks in advance for your advice, and thanks again for this useful package.