I was recently working with a dataset on arsenic poisoning. Among the variables in the dataset, I used the following three variables to produce crosstabulations (variable names: FOLSTAT, GENDER, ASBIN; all three were categorical variables, FOLSTAT denoted follow up status for the subjects and had seven levels, GENDER denoted sex (two levels: male,female), and ASBIN denoted binarized arsenic concentrations (two levels: "<0.05", ">0.05" denoting less than 0.05 mg/L and more than 0.05 mg/L respectively).
To illustrate, I used the following code for crosstabulation:
x <- table(FOLSTAT,GENDER,ASBIN)
# from the results, I then wanted to subset a table for the ASBIN
value ">0.05"
I used the following code to subset the table:
y <- x[,,ASBIN=">0.05"]
# When I do this, R throws an error message stating "subscript out of range". However, it runs fine if I change the labels for my ASBIN variable from "<0.05" and ">=0.05" to words like "Nonexposed" and "Exposed" respectively.
I searched the archives and the documentations for this, but could not find a solution. I understand that sometimes it is more expressive to use expressions like "<0.05" (or something similar) as headings in cross-tabulations. What was I doing incorrectly?
Would greatly appreciate your insight.
I use:
R version: 1.7.1
OS: Windows XP Home
TIA, Arin Basu
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
