s-news
[Top] [All Lists]

switch keyword

To: s-news@lists.biostat.wustl.edu
Subject: switch keyword
From: carol white <wht_crl@yahoo.com>
Date: Tue, 9 Oct 2007 07:08:33 -0700 (PDT)
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=sk4XKEFL5vmoDxI7GZx1DiThzxvVAgGhHdTZzlz4djBbbiH0MWOMZHS4uAj4zAug0rZH7EjEY14Xk4fXFwFPAyR2TGk8nUlKv5di9TjolH4GjM5tDwZI5K9h4dtKO5OYPDDW3AF1YrtYnZG0UjNYMOJu+POQfFVqsTjQQ23QuZM=;
Hi,
I have an integer vector that I want to convert to a categorical vector with values 1, 2, 3.
If the value of an element of the integer vector < 20, then, the value of the corresponding element in the categorical vector will be 1
if the value of an element of the integer vector > 20 and < 50, then, the value of the corresponding element in the categorical vector will be 2
if the value of an element of the integer vector > 50, then, the value of the corresponding element in the categorical vector will be 3

can I do this by switch and how

look forward to your feedback

carol


Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
<Prev in Thread] Current Thread [Next in Thread>