Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: collapse in forv....


From   "Rajiv Mallick" <[email protected]>
To   [email protected]
Subject   st: collapse in forv....
Date   Wed, 22 Jan 2003 18:19:36 -0600

I need help with running the following code. I want column totals, and a simple collapse command would do the job. But I have to take column totals of 1000 variables, and a huge collapse commands freezes the computer. I am trying the following code. I already have a file named e:\data\pricelog.dta, and the program should be able to append the existing file. But it does not. It stops with first collapse run. Do appreciate your looking into it.

Thank you for your help, suggestions.

Regards
Rajiv


code
--------
#delimit;
clear ;
use "D:\Stata\auto.dta", clear;
rename price price1;
rename mpg price2 ;
rename headroom price3;
save "e:\data\auto.dta", replace;

forv i=1/3 { ;
rename price`i' pa;
collapse (sum) pa;
append using "e:\data\pricelog.dta", nolabel;
clear;
use "e:\visa_clm\data\auto.dta", clear;
} ;

use "e:\data\pricelog.dta", clear;
summ;
----
end of code



------
huge collapse command!!!!!
------
collapse (sum)

price1 price2 price3 price4 price5 price6 price7 price8 price9 price10 price11 price12 price13 price14 price15 price16 price17 price18 price19 price20 price21 price22 price23 price24 price25 price26 price27 price28 price29 price30 price31 price32 price33 price34 price35 price36 price37 price38 price39 price40 price41 price42 price43 price44 price45 price46 price47 price48 price49 price50
price51 price52 price53 price54 price55 price56 price57 price58 price59 price60 price61 price62 price63 price64 price65 price66 price67 price68 price69 price70 price71 price72 price73 price74 price75 price76 price77 price78 price79 price80 price81 price82 price83 price84 price85 price86 price87 price88 price89 price90 price91 price92 price93 price94 price95 price96 price97 price98 price99 price100


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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