简体   繁体   中英

Weighted censored regression in R?

I am very new to R (mostly program in SQL) but was faced with a problem that SQL couldn't help me with. I'll try to simplify the problem below.

Assume I have a set of data with 100 rows where each row has a different weight associated with it. Out of those 100 rows of data, 5 have an X value that is top-coded at 1000. Also assume that X can be represented by the linear equation X ~ Y + Z + U + 0 (want a positive value so I don't want a Y-intercept).

Now, without taking the weights of each row of data into consideration, the formula I used in R was:

fit = censReg(X ~ Y + Z + U + 0, left = -Inf, right = 1000, data = dataset)

If I computed summary(fit) I would get 0 left-censored values, 95 uncensored values, and 5 right censored values which is exactly what I want, minus the fact that the weights haven't been sufficiently added into the mix. I checked the reference manual on the censReg function and it doesn't seem like it accepts a weight argument.

Is there something I'm missing about the censReg function or is there another function that would be of better use to me? My end goal is to estimate X in the cases where it is censored (ie the 5 cases where it is 1000).

You should use Tobit regression for this situation, it is designed specifically to linearly model latent variables such as the one you describe.

The regression accounts for your weights and the censored observations, which can be seen in the derivation of the log-likelihood function for the Type I Tobit (upper and lower bounded).

Tobit regression can be found in the VGAM package using the vglm function with a tobit control parameter. An excellent example can be found here:

http://www.ats.ucla.edu/stat/r/dae/tobit.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM