[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: Producing averages for cross sectional data by ID
Sorting by farmer ID is not necessary. You can
get the averages with a suitable -egen, mean()-
and -by()- or -by:-.
> I would like to produces averages in my cross sectional data and was
> wondering how to do it.
> I have cross sectional data on 300 plots for 100 farmers.
> Each plot is
> associated with a farmer's identification. Hence the same
> farmer can have
> multiple plots.
> I would like to estimate the following production function for my 100
> where i= ith farmer, Y = output, and X1i,X2i...'s= various
> inputs of the ith
> Yibar=average output of ith farmer calculated over his multiple plots,
> X1ibar=average of input1 of ith farmer calculated over his
> multiple plots
> How can I select the ith farmer from my data and calculate
> averages? Note
> that each farmer has a farmerID
> I know that I must sort the data by "farmerID" but what comes after?
* For searches and help try: