Bookmark and Share

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]

st: Re: Variable selection


From   "Sherriff, Martyn" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Re: Variable selection
Date   Fri, 4 Mar 2011 09:40:10 +0000

I have a dataset with 125 variables and I only need to analyse a subset of them. Rather than write a 'locaI' to include the variables that I wish to analyse I have tried to exclude the variables that I do not want as follows:

qui:findname
foreach v of varlist `r(varlist)'{
	if "`v'" !="chew" {
	kwallis `v',by(ur6)
	}
	}
And this works for the exclusion of a single variable. However if I include more than one variable:

	if "`v'" !="chew" |" `v'" !="subject" {

then no variables are excluded.

Could somebody advise me of the syntax error that I am making - or an improved way of solving the problem?

Thanks,
Martyn


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


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