BookmarkSubscribeRSS Feed
Caetreviop543
Obsidian | Level 7

I used proc nlmixed to implement a left-censored (aka Tobit), knotted spline, mixed effects regression. V1 is time in weeks relative to the intervention start (-33 to 34), and V2 is a truncated time variable in weeks with a knot at the intervention start (0 to 34). The outcome, log_y, is the log of a medication dosage with a range from 3.2 to 8.05. The data is organized as the average weekly medication dosage per-clinician. Many clinicians have average weekly dosages of 0, which is why we used a left-censored regression. 

proc nlmixed data=mydat XTOL=1E-12 method=GAUSS qpoints=100;
parms b0=1.6 b1=-.04 b2=-.5 sigma2_u=2 sigma2=5;
bounds sigma2_u sigma2 >=0;
pi = constant("pi");
mu = b0 + b_0j + b1*v1 + b2*v2;
if log_y > 0 then 
ll = (1 / (sqrt(2*pi*sigma2))) * exp( -(log_y-mu)**2 / (2*sigma2) );
if log_y = 0 then 
ll = probnorm( (log_y - mu) / sqrt(sigma2) );
L = log(ll);
model log_y ~ general(L);
random b_0j ~ normal(0, sigma2_u) subject=id;
run;
quit;

Everything worked fine; the probability density function and cumulative density function were used on uncensored and censored obs. respectively to achieve the maximum log likelihood. Here are the estimates:

b0: -12.65
b1: -0.03
b2: -0.01
sigma2_u: 9.02
sigma1: 85.49

But then a colleague told me I need adjust the coefficients to convert to OLS scale according to Wooldridge (Chapter 17.2, pages 596-601) found here:

https://economics.ut.ac.ir/documents/3030266/14100645/Jeffrey_M._Wooldridge_Introductory_Econometric...

 

My questions are:

 

1. Is this necessary if the algorithm accounted for censored obs. by using the cumulative density function to maximize the likelihood? 

 

2. If this is necessary, the average partial effect (APE), is the scale factor. The equation occurs in the second sentence in paragraph five on page 600. My interpretation is that it's each predicted value for every level of x divided by sigma, summed, and divided by one. As an example with limited obs.:

 

intercept  V1  coef_V1  V2  coef_V2  xi(b) sigma (xi(b))/sigma sum (1/sum) APE
-12.65     -1    -0.03   0   -0.01  -12.62  85.49  -.1476 -0.444  1/-.444 -2.3
-12.65      0    -0.03   0   -0.01  -12.65  85.49  -.1479
-12.65      1    -0.03   1   -0.01  -12.69  85.49  -.1484

 

Is this correct?

 

3. According to Wooldridge in the second paragraph on page 599 just below equation 17.26, the adjustment factor (xb/sigma) can be achieved by plugging in the maximum likelihood estimates, and is always between 0 and 1. This obviously wasn't true for me because I have negative estimates. Then I saw in table 17.2 (pg. 601) two types of estimates, Tobit and MLE.

  1. What is the difference between these estimates? Why are the Tobit estimates negative, and the MLE positive? Plugging in                                          positive MLE estimates would result in a pos. adjustment factor between 0 and 1, so that makes sense, I just don't understand the difference. My first thought was that the MLEs are from a maximum likelihood regression on just uncensored obs., whereas the tobit incorporates censored obs (and can therefore have negative estimates). If this is the case, that brings me back to my original question, is the adjustment even necessary if using proc nlmixed?

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 470 views
  • 2 likes
  • 1 in conversation