Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: RE: -local- problem
From
saqlain raza <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: RE: -local- problem
Date
Wed, 16 Nov 2011 07:34:03 -0800 (PST)
Thanks Fernando Rios Avila. It works now
Saqlain RAZA
PhD Student ([email protected])
----- Original Message -----
From: Fernando Rios Avila <[email protected]>
To: [email protected]
Cc:
Sent: Wednesday, November 16, 2011 4:20 PM
Subject: Re: st: RE: -local- problem
have you done :
sum affiloui
first?
On Wed, Nov 16, 2011 at 10:12 AM, saqlain raza <[email protected]> wrote:
> Thank you Nick.
>
> gen affiloui2=(affiloui - r(mean))/r(sd) creates the variable but it do not show any values of the variable, it shows only dots (.). How could it be dealt with?
>
> Saqlain RAZA
> PhD Student ([email protected])
>
>
>
>
> ----- Original Message -----
> From: Nick Cox <[email protected]>
> To: "'[email protected]'" <[email protected]>
> Cc:
> Sent: Wednesday, November 16, 2011 3:50 PM
> Subject: st: RE: -local- problem
>
> This problem was explained yesterday. The opening and closing ticks should be different:
>
> `m'
>
> Note that in your example locals are unnecessary and just complicate the code:
>
> gen affiloui2=(affiloui - r(mean))/r(sd)
>
> Nick
> [email protected]
>
> saqlain raza
>
> I am in try to make a -local- with the following command:
>
> local m=r(mean)
> local sd=r(sd)
>
> Then I try to generate a variable.
>
> gen affiloui2=(affiloui - 'm')/'sd'
>
> but it gives me an error
>
> 'm' invalid name
> r(198);
>
> I have tried with double quotes but even then it is not working. How this problem can be solved? Is there any problem in making -local-? Note that affiloui is already a variable in the database.
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/