Appreciate any suggestions regarding how to fit an unbalanced panel data to a Tobit model using R functions. I am trying to analyze how real estate capital expenditures (CapEx) are affected by market conditions using a panel Tobit model. The CapEx is either positive or 0, so it is censored. The data are unbalanced panel, including the CapEx of about 5000 properties over about 40 quarters, with the starting and ending quarters differ across properties. In case you are not familiar with the term "Tobit", the model is essentially the following. The "true" value of the CapEx of property i in quarter t, Y*[i,t], is determined by a property fixed effect (dummy) a[i], explanatory variables x[I,t], and an error: Y*[i,t]=a[i]+b*X[i,t]+u[i,t]. Further, the observed CapEx, Y[i,t], equals Y*[i,t] if Y[i,t]>0 and equals 0 otherwise. Now I observe Y[i,t] and X[i,t], and the purpose of this analysis is to estimate coefficients b. Thanks for any suggestions! Regards, Liang Peng
On Tue, 23 Nov 2010, Liang Peng wrote:> Appreciate any suggestions regarding how to fit an unbalanced panel data to > a Tobit model using R functions. I am trying to analyze how real estate > capital expenditures (CapEx) are affected by market conditions using a panel > Tobit model. The CapEx is either positive or 0, so it is censored. The data > are unbalanced panel, including the CapEx of about 5000 properties over > about 40 quarters, with the starting and ending quarters differ across > properties. > > In case you are not familiar with the term "Tobit", the model is essentially > the following. The "true" value of the CapEx of property i in quarter t, > Y*[i,t], is determined by a property fixed effect (dummy) a[i], explanatory > variables x[I,t], and an error: Y*[i,t]=a[i]+b*X[i,t]+u[i,t]. Further, the > observed CapEx, Y[i,t], equals Y*[i,t] if Y[i,t]>0 and equals 0 otherwise. > Now I observe Y[i,t] and X[i,t], and the purpose of this analysis is to > estimate coefficients b. Thanks for any suggestions!I think that the "censReg" package might be worth exploring, see http://CRAN.R-project.org/package=censReg I haven't looked at the package in detail yet, but it says that it is concerned with "estimation of censored regression (Tobit) models with cross-section and panel data". hth, Z> Regards, > > Liang Peng > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
For tobit regression, also see the last example of help(survreg) in the survival package. Terry Therneau
Dear All, I have been trying to connect to haver to download data and have made some good progress. I am stuck at a point and would appreciate your help. Haver provides a dll called DLXAPI32 using which i can connect to excel/vb/c etc. Now i tried calling it from R and used following code: options(warn.FPU = TRUE) dyn.load("DLL/dlxapi32.dll") Warning message: In inDL(x, as.logical(local), as.logical(now), ...) : DLL attempted to change FPU control word from 8001f to 9001f --- gives a warning that dll attempted to change hex code Since its just a warning, I ignored it, since my code options(warn.FPU = TRUE) will let me know if the hex code is actually changed is.loaded("DLXOpenDatabase") [1] TRUE # is.loaded is a function to check if "DLXOpenDatabase" symbol is loaded. As the output shows this symbol gets loaded and is ready to be used> is.loaded("DLXOpenDatabase")[1] TRUE> is.loaded("DLXOpenDatabase",type= "C")[1] TRUE> is.loaded("DLXOpenDatabase",type= "Call")[1] TRUE> is.loaded("DLXOpenDatabase",type= "External")[1] TRUE> is.loaded("DLXOpenDatabase",type= "Fortran")[1] TRUE Above code lines show that the function DLXOpenDatabase is available to be used. Now, when i use the following call the R crashes .C("DLXOpenDatabase","W:/DLX/USECON") "W:/DLX/USECON" is parameter for the function DLXOpenDatabase which is successfully used in VB call Normally this call should give me an output "0" which shows the connection is successfully established, but the R crashes. My question is "Is this because Haver DLL malfunctioned" or is this because i am doing something wrong. http://127.0.0.1:29087/library/base/html/dynload.html is the link to help i used Thanks in advance for your help. Amit
Hi Terry On 24 November 2010 15:34, Terry Therneau <therneau at mayo.edu> wrote:> For tobit regression, also see the last example of help(survreg) in the > survival package.How does the survreg() function of the "survival" package account for the panel structure of the data? Best wishes, Arne -- Arne Henningsen http://www.arne-henningsen.name