Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: RE: -local- problem

From   Nick Cox <>
To   "''" <>
Subject   st: RE: -local- problem
Date   Wed, 16 Nov 2011 14:50:49 +0000

This problem was explained yesterday. The opening and closing ticks should be different: 


Note that in your example locals are unnecessary and just complicate the code: 

gen affiloui2=(affiloui - r(mean))/r(sd) 


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

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:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index