predint.txt problems
Posted: Mon Sep 10, 2012 4:00 pm
Hi,
I am running a cross classified 4 level model with a binary outcome using MCMC. I want to plot the regression lines it produces, plus the 95% confidence interval of that line. It has a random intercept at every level but no random slope. I am following the instructions in chapter 6 of the MCMC manual. I ran the MCMC model with 5001 iterations, storing the level 2 residuals only in column c200. Then i ran the macro predint.txt. I get the following error message:
error while obeying batch file ...at line number 16, calc c350 = c81+cb11 + b3 * (c82+cb12)
arithmetic expression too complicated
I think it is the cb11/cb12 reference - what does this refer to? I tried changing it to b11/b12 and its runs OK, but i get a very odd output graph. I would really appreciate some advice, I have copied the whole macro below for reference
Many thanks in advance,
Sian
Note macro creates prediction curves with error bands for a random slopes regression model
erase c21-c23
note put residuals into c201-c265 (intercepts) and c301-c365 (slopes)
code 130 1 5001 c199
split c200 c199 c201-c330
code 6 1 5001 c89
note put fixed intercept and slope in columns c81 and c82
split c1090 c89 c81-c86
note loop around all individuals
loop b1 1 45391
pick b1 '1_4R1ID' b2
pick b1 '1_41hrexclfirstR1' b3
calc b11 = 2*b2 + 199
calc b12 = 2*b2 + 200
note calculate the derived predicted values for individual b1 and put in c300
calc c350 = c81+cb11 + b3 * (c82+cb12)
sort c350 c350
note pick out quantiles and median for individual b1
pick 125 c350 b21
pick 2500 c350 b22
pick 4875 c350 b23
join c21 b21 c21
join c22 b22 c22
join c23 b23 c23
endl
Note transform quantiles into differences
calc c21 = c22 - c21
calc c23 = c23 - c22
name c22 'pred'
name c21 'lowlim'
name c23 'uplim'
(note 45391 is the number of people i have at level 1, '1_4R1ID' is the level 2 category, and '1_41hrexclfirstR1' is the main predictor of interest in my model.)
I am running a cross classified 4 level model with a binary outcome using MCMC. I want to plot the regression lines it produces, plus the 95% confidence interval of that line. It has a random intercept at every level but no random slope. I am following the instructions in chapter 6 of the MCMC manual. I ran the MCMC model with 5001 iterations, storing the level 2 residuals only in column c200. Then i ran the macro predint.txt. I get the following error message:
error while obeying batch file ...at line number 16, calc c350 = c81+cb11 + b3 * (c82+cb12)
arithmetic expression too complicated
I think it is the cb11/cb12 reference - what does this refer to? I tried changing it to b11/b12 and its runs OK, but i get a very odd output graph. I would really appreciate some advice, I have copied the whole macro below for reference
Many thanks in advance,
Sian
Note macro creates prediction curves with error bands for a random slopes regression model
erase c21-c23
note put residuals into c201-c265 (intercepts) and c301-c365 (slopes)
code 130 1 5001 c199
split c200 c199 c201-c330
code 6 1 5001 c89
note put fixed intercept and slope in columns c81 and c82
split c1090 c89 c81-c86
note loop around all individuals
loop b1 1 45391
pick b1 '1_4R1ID' b2
pick b1 '1_41hrexclfirstR1' b3
calc b11 = 2*b2 + 199
calc b12 = 2*b2 + 200
note calculate the derived predicted values for individual b1 and put in c300
calc c350 = c81+cb11 + b3 * (c82+cb12)
sort c350 c350
note pick out quantiles and median for individual b1
pick 125 c350 b21
pick 2500 c350 b22
pick 4875 c350 b23
join c21 b21 c21
join c22 b22 c22
join c23 b23 c23
endl
Note transform quantiles into differences
calc c21 = c22 - c21
calc c23 = c23 - c22
name c22 'pred'
name c21 'lowlim'
name c23 'uplim'
(note 45391 is the number of people i have at level 1, '1_4R1ID' is the level 2 category, and '1_41hrexclfirstR1' is the main predictor of interest in my model.)