[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Question about "predict" and "mean" when i ~= (not equal) j?

From   "Sun, Yan (IFPRI)" <[email protected]>
To   <[email protected]>
Subject   st: Question about "predict" and "mean" when i ~= (not equal) j?
Date   Tue, 24 Nov 2009 17:05:32 -0500

Hi, all,

Theoretically, my question is easy; but I do not know how to program it
in STATA. 

Y is my dependent variable, X1, X2, X3 are my independent variable,
i/j=1, 2, ..., n are my observations, m=1, 2, ...,20 is city, my
equation is Y==X1 X2 X3. What I want to calculate is  GAP(i~=j,
m)=Predicted Y(j) for i-mean(j, m) (j is all the other observations). I
know how to do for the equation GAP(i,m)=Predicted Y(i)-mean(i,m) , in
this case, what I do is 
Reg Y X1 X2 X3
Predict PY, xb
Gen gap=PY-Y
collapse gap, by(m)

But I do not know how to predict and calculate the value which does not
include the current observation (the predicted value and the mean value
which excludes the current value)?

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index