bhavin toprani wrote:
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.
This will result in a very poor analysis. See
http://biostat.mc.vanderbilt.edu/CatContinuous
The first reference there shows how the resulting effects are almost
impossible to interpret.
Frank
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!
<https://www.searchcharades.com>
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
|