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: macro issue - output
From
"Dherani, Mukesh" <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
RE: st: macro issue - output
Date
Wed, 6 Mar 2013 14:23:57 +0000
Thank you Nick.
No I am using it in the same do file for same analysis.
local x var1 var2 varn // first I ran this command
logistic y `x' // then I ran this command in the same file and result is blank
Here is the output:
. do "C:\Users\dheranim\AppData\Local\Temp\STD00000000.tmp"
. local unisig rsvtest appearance mdc7 mdrrate mdrrate10 mdrrate60 mdd1 mdd4 chestin ronchi mdd14 irritable apparatuso2 orientfeed
.
end of do-file
. do "C:\Users\dheranim\AppData\Local\Temp\STD00000000.tmp"
. logistic hypoxalri intervention `unisig'
Logistic regression Number of obs = 260
LR chi2(1) = 1.46
Prob > chi2 = 0.2267
Log likelihood = -179.21038 Pseudo R2 = 0.0041
------------------------------------------------------------------------------
hypoxalri | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
intervention | .7401316 .1844639 -1.21 0.227 .4541119 1.206299
------------------------------------------------------------------------------
BW,m
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: 06 March 2013 12:58
To: [email protected]
Subject: Re: st: macro issue
At a guess you are defining a -local- macro in one place and trying to use it in another.
A local macro is only visible in the same place -- one might say locale -- in which it is defined, meaning
the _same_ interactive session
the _same_ do-file
the _same_ block of commands in the do-file editor
the _same_ program.
The way to remember it is that that is what -local- means!
Note that -if- is not an option. You don't mention how you are using -if-, but it is either a qualifier or a command.
Nick
On Wed, Mar 6, 2013 at 12:49 PM, Dherani, Mukesh <[email protected]> wrote:
> I am new to macro. I am trying to carryout logistic regression with a
> number of options using if option, however, I am not getting my
> command being carried out. Below is what I am trying to do
>
> If I use
> local x var1 var2 varn
> logistic y `x' // when both of the rows are selected and run simultaneously in do file then command proceeds,
>
> otherwise it returns without any results as below:
>
> local x var1 var2 varn // first ran this command
>
> logistic y `x' // then this. Result is blank..
>
> I am using stata 10.
> what is my mistake? I tried looking at FAQ but cannot simplify my query and= got a number of answers not related to my issue. thank you in advance.
*
* 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/
*
* 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/
*
* 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/