Dear Professor King,I was doing some literature reading and I came across your software. I try the package with my own data but I got some error.I modified my data and make it look like the example data in the file path of the package. yourprep runs smoothly with some data like below:
dta$data$`204500`rspi2 popu2 time2004 NA 4858042 19942005 NA 4785805 19952006 NA 4704201 19962007 0.006431800 4592693 19972008 0.005454000 4522168 19982009 0.005908178 4432729 19992010 0.005238223 4317368 20002011 0.005180368 4237330 20012012 0.004544100 4176305 20022013 0.004363600 4098927 20032014 0.003821751 4056178 20042015 0.003390900 3958900 20052016 NA NA 20062017 NA NA 20072018 NA NA 20082019 NA NA 20092020 NA NA 20102021 NA NA 20112022 NA NA 20122023 NA NA 20132024 NA NA 20142025 NA NA 2015
But then I got error with yourcast() command.
The scripts run below:> dta <- yourprep(dpath='./GARY_KING_CHINA_mortality',index.code=" ggggaa", tag="csid", + year.var=TRUE, sample.frame=c(2004,2015,2016,2025), + G.names="cntry.codes.txt", adjacency="adjacency.txt",+ verbose=TRUE,summary=FALSE)Loading cross section files and checking for errors...csid204500.txtcsid204501.txtcsid204505.txtcsid204510.txtcsid204515.txtcsid204520.txtcsid204525.txtcsid204530.txtcsid204535.txtcsid204540.txtcsid204545.txtcsid204550.txtcsid204555.txtcsid204560.txtcsid204565.txtcsid204570.txtcsid204575.txtcsid204580.txtcsid204585.txtLoading auxiliary files...cntry.codes.txtadjacency.txt...FinishedTotal number of cross sections: 19
ylc <- yourcast(formula=log(rspi2/popu2) ~ time, dataobj=dta, model="LC",debug =TRUE) Error in seq.default(smpvec[ind], smpvec[ln], by = 1) :wrong sign in 'by' argument
Thank you for your help!
Antonio Lam