Bookmark and Share

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, is already up and running.

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

st: Re: AW: sort of standardization

From   Ginevra Biino <>
Subject   st: Re: AW: sort of standardization
Date   Wed, 12 May 2010 16:47:23 +0200

no html, exactly. ;-)

Thanks a lot,
very efficient as usual


----- Original Message ----- From: "Martin Weiss" <>
To: <>
Sent: Wednesday, May 12, 2010 4:37 PM
Subject: st: AW: sort of standardization


No html, right?


set obs 100

gen x1=rnormal()
gen x2=rnormal()
gen str5 x3="Hello"

qui ds, has(type numeric)

foreach var of varlist `r(varlist)'{
egen std_`var'=std(`var')
su `var', mean

gen rangecorrected_`var'=`var'/(`r(max)'-`r(min)')


[] Im Auftrag von Ginevra Biino
Gesendet: Mittwoch, 12. Mai 2010 16:30
An: Statalist
Betreff: st: sort of standardization

Dear Statalist,
I have to standardize many variables (in order to run PCA).
Besides generating the n corresponding std(varname) vars, which I have
already done, I also want to generate n new variables obtained dividing
each variable by its range. Can anybody help me?

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index