s-news
[Top] [All Lists]

categorising weight

To: "s-news@lists.biostat.wustl.edu" <s-news@lists.biostat.wustl.edu>
Subject: categorising weight
From: bhavin toprani <b_toprani@hotmail.com>
Date: Mon, 7 Jan 2008 22:56:32 +0000
Importance: Normal
Dear all,
 
I have data of 797 pregnant women and the dataframe is anaemia.
It has 6 variables: anaemia is the response variable of interest is binary.
                         wt is continuous
                         ceb is categorical
                         educ is categorical
                         region is categorical
                         age is categorical
I want to use log linear models to investigate the association structure of the potential bio-demographic explanatory variables after categorising weight.
I want to categorise wt as <= 50, >50 AND <= 60, AND > 60.
I did this
 
var <- ifelse(anaemia$wt <= 50, 1, 0)
ifelse(anaemia$wt > 50 & anaemia$wt <= 60, 2, var)
ifelse(anaemia$wt > 60, 3, var)
cbind(anaemia, var)
 
This does not work. Please let me know my mistake. Any suggestions welcome.
Thanks in advance.
 
Bhavin


Think you know your TV, music and film? Try Search Charades!
<Prev in Thread] Current Thread [Next in Thread>