I am trying to run fixed effects and random effects regressions on data which to my understanding is "pseudo" panel data. The dataset consists of rows of syndicated loans with borrower country-level variables attached. The question is how can I apply pdata.frame()
to my data when my data has multiple observations (loans) per country-year pair? If I try to use year and country I get the following error:
Warning in pdata.frame(df, index = c("borrower_country", "year")) :
duplicate couples (id-time) in resulting pdata.frame
to find out which, use, e.g., table(index(your_pdataframe), useNA = "ifany")
I've found some related questions on the topic (link), but I don't see how they would apply to my case. Each loan in the data has a unique id number, but if I were to pair that with e.g. year like was suggested in the link, wouldn't that ruin any year fixed/random effects I may want?
I know that panel data methods have been used in studies with a similar data structure, but I don't understand how to apply the methods to my data.