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

Re: st: SAS proc format and regression


From   Nick Winter <[email protected]>
To   [email protected]
Subject   Re: st: SAS proc format and regression
Date   Thu, 08 Jul 2004 13:50:57 -0400

I'm not entirely clear on what is going on in your SAS syntax (a problem I have a lot with SAS syntax . . .), but I think you cannot do what you want without creating a new variable.

Certainly -label- is not the tool for the job--it only deals with the names attached to the underlying values of a variable, and is irrelevant to estimation commands.

Why not do this:

generate byte schoolhi = school>=12 if school<.
logistic y schoolhi

I'll note that this takes two lines of code, compared with the 8 in SAS.

--Nick Winter


At 12:22 PM 7/8/2004 -0400, you wrote:

Hi,
In SAS, we can use proc format to change label value, for example, school is the years of schooling, which ranges 0 to 17. We can use:
proc format;
value school low-<12='<12' 12-high='12+';
run;
later in regression we can use the format so that school is inlucded as a dummy variable:
proc logistic;
class school;
model y=school;
format school school.;
run;
How do we achieve the same goal in Stata without creating new variables? I thought we could use label define and label value, but it didn't work.
Thanks a lot,

Zhehui

*
* 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/
--------------------------------------------------------
Nicholas Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government [email protected] e
308 White Hall falcon.arts.cornell.edu/nw53 w
Cornell University
Ithaca, NY 14853-4601

*
* 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