Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
David Kantor <kantor.d@att.net> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Going through each observation of a variable |

Date |
Sat, 08 Jun 2013 17:44:00 -0400 |

Hello Derya, See below. At 02:52 PM 6/8/2013, you wrote:

Hi David,Organization of the data is that I simply copy-pasted these pricesin the data as additional variables. The variables Price1 and Price2has 500 observations, each row representing a price vector. os1 andos2 are the expenditure shares for each individual and has 80,000observations.I am computing Y for each individual as the expenditure share ofgood1 for each individual (os1), multiplied by price of good 1 (P1)plus the same for good 2. If I had only a single price vector, thisis straightforward to compute. I could just write'genY=os1*P1+os2*P2'. But I have 500 different price vectors. Iwould like to generate Y 500 times, and take the average across the 500.The program I posted choose randomly from these price vectors. But Idon't want randomness at this stage. I would like to compute Y foreach price vector one by one...This is what I meant by replication.Here is an example with 3 price vectors and 10 individuals to showwhat I am trying to do: https://www.dropbox.com/s/boslxhpkyljcq45/Book1.xlsxThanks again, greatly appreciated! Derya [...]

It seems that you have two datasets: 1, prices: 500 observations 2, individuals: 80000 obsrvations Or that in some virtual sense, this is what you have. But it's still not clear how you have it organized.

But again, that's a lot of observations. Your system might choke.

Other options: create wide data; still a lot of data.

--David * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: Going through each observation of a variable***From:*Derya Karaci <dkaraci@yahoo.com>

**References**:**st: Going through each observation of a variable***From:*Derya Karaci <dkaraci@yahoo.com>

**Re: st: Going through each observation of a variable***From:*David Kantor <kantor.d@att.net>

**Re: st: Going through each observation of a variable***From:*Derya Karaci <dkaraci@yahoo.com>

**Re: st: Going through each observation of a variable***From:*David Kantor <kantor.d@att.net>

**Re: st: Going through each observation of a variable***From:*Derya Karaci <dkaraci@yahoo.com>

- Prev by Date:
**Re: st: Interpretation of interaction term in log linear (non linear) model** - Next by Date:
**Re: st: How to store marginal effect value after using margin command?** - Previous by thread:
**Re: st: Going through each observation of a variable** - Next by thread:
**Re: st: Going through each observation of a variable** - Index(es):