Closed farahaawad closed 4 years ago
Can you provide me with the code and data you are using? So that I have a starting point for digging into the issue. If you are not comfortable sharing the code, feel free to send me the material via email.
Dear Mark, Thank you for your prompt response. Unforfutently, the data I’m using is confidential for the institution I’m working with. However, I tried the code with a small dataset which I made up (attached) and got the same error.
The code I have used: GMM2 <- pdynmc(dat= test_data, varname.i = "ID", varname.t = "Year",use.mc.diff = FALSE, use.mc.lev = FALSE, use.mc.nonlin = FALSE, include.y = TRUE, varname.y = "Y", lagTerms.y = 1, fur.con = TRUE, fur.con.diff = FALSE,fur.con.lev = TRUE, varname.reg.fur = c("X1", "X2"),lagTerms.reg.fur = c(0), include.dum = FALSE, dum.diff = FALSE, dum.lev = FALSE, w.mat="iid.err", std.err = "corrected", estimation = "onestep")
The error: Error: Can't subset columns that don't exist. x Locations 2, 3, and 4 don't exist. i There are only 1 column.
Please advise.
Best regards, Farah From: markusfritschmailto:notifications@github.com Sent: 08 July 2020 13:32 To: markusfritsch/pdynmcmailto:pdynmc@noreply.github.com Cc: farahaawadmailto:farah@awads.org; Authormailto:author@noreply.github.com Subject: Re: [markusfritsch/pdynmc] Error: Can't subset columns that don't exist (#1)
Can you provide me with the code and data you are using? So that I have a starting point for digging into the issue. If you are not comfortable sharing the code, feel free to send me the material via email.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmarkusfritsch%2Fpdynmc%2Fissues%2F1%23issuecomment-655435531&data=02%7C01%7C%7Cd2de197805914febf05d08d8232a4593%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637298011742720327&sdata=7Y5hDDcD2vy%2FBdiFRO32OCHpoE3CRQ3LHem%2FRwjH5gI%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQG3DGEBG4AU3IC44SMR7H3R2RDNJANCNFSM4OUMTRGQ&data=02%7C01%7C%7Cd2de197805914febf05d08d8232a4593%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637298011742730312&sdata=sMxJqyQMsDWjnVeGTFC6%2FCmHLGt2oSvD0rkLFjH9EuQ%3D&reserved=0.
Hi, gentle reminder
Dear Farah,
there are two things going on here.
(1) You are estimating a linear dynamic panel data model based on linear and/or nonlinear moment conditions with pdynmc(). In your code, you are not using any moment conditions (as arguments use.mc.diff, use.mc.lev, and use.mc.nonlin are set to FALSE). For more details on the method, see the package vignette and the documents linked there.
(2) You are using further controls in your model. Please note that the vector giving the names of the further controls (varname.reg.fur) and the vector specifying the dynamic structure of the further controls (lagTerms.reg.fur) need to have the same length.
Below is a code with a minimal working example:
install.packages("pdynmc") library(pdynmc) install.packages("plm") library(plm)
data(EmplUK) test_data <- EmplUK[1:105, c(1:2, 4:6)] names(test_data) <- c("ID", "Year", "Y", "X1", "X2")
GMM2 <- pdynmc(dat= test_data, varname.i = "ID", varname.t = "Year", use.mc.diff = TRUE, use.mc.lev = FALSE, use.mc.nonlin = FALSE, include.y = TRUE, varname.y = "Y", lagTerms.y = 1, fur.con = TRUE, fur.con.diff = FALSE,fur.con.lev = TRUE, varname.reg.fur = c("X1", "X2"),lagTerms.reg.fur = c(0,0), include.dum = FALSE, dum.diff = FALSE, dum.lev = FALSE, w.mat="iid.err", std.err = "corrected", estimation = "onestep")
Best regards Markus
I keep getting this error when I use the pdynmc function, even though I can see that the column exists in my dataset. Error: Can't subset columns that don't exist. x Locations 14, 15, 16, 2, 17, etc. don't exist. i There are only 1 column