0

I am trying to generate this graph. Using this package

Following is in datafile
RAND,PREF,SEA,SN

Cummulative,Q1,68,1238
Current,Q1,67,1243
Cummulative,Q2,70,1238
Current,Q2,69,1243
Cummulative,Q3,75,1238
Current,Q3,75,1243
Cummulative,Q4,78,1238
Current,Q4,81,1243
Cummulative,Q5,71,1238
Current,Q5,68,1243
Cummulative,Q6,77,1238
Current,Q6,76,1243
Cummulative,Q7,78,1238
Current,Q7,80,1243
Cummulative,Q8,78,1238
Current,Q8,81,1243
Cummulative,Q9,69,1238
Current,Q9,68,1243
Cummulative,Q10,69,1238
Current,Q10,68,1243
Cummulative,Q11,73,1238
Current,Q11,74,1243
Cummulative,Q12,77,1238
Current,Q12,79,1243
Cummulative,Q13,74,1238
Current,Q13,73,1243
Cummulative,Q14,76,1238
Current,Q14,75,1243
Cummulative,Q15,71,1238
Current,Q15,72,1243
Cummulative,Q16,63,1238
Current,Q16,67,1243
Cummulative,Q17,71,1238
Current,Q17,70,1243

code:

eqdata <- read.table(datafile , header = T,sep=",")
#eqdata <- as.data.frame(eqdata)
eqdata1 <- hh(eqdata)

aed <- logrelrisk(eqdata1)

p <- ae.dotplot(aed, A.name="TREATMENT A (N=216)",B.name="TREATMENT B (N=431)")

Output: Error in ae$SAE : $ operator is invalid for atomic vectors Calls: logrelrisk

any help much appreciated.

henna
  • 368
  • 3
  • 13
  • Its working now!!! Problem was SEA. Its infact SAE. came to know when i saw function definition. All good now. – henna Apr 12 '12 at 05:59
  • Did you also have to remove `eqdata1 <- hh(eqdata)` as suggested below? If so, it would be important to indicate this (for example by accepting the answer) so that others with a similar problem who find this post know all they need to fix. – BenBarnes Apr 12 '12 at 07:27

1 Answers1

0

Cut out the eqdata1 <- hh(eqdata) line. From the ?hh documentation, this function merely returns the path to the specified file, and is thus not a data.frame, as is required by logrelrisk().

eqdata <- read.table(datafile , header = T,sep=",")
#eqdata <- as.data.frame(eqdata)
# eqdata1 <- hh(eqdata)

aed <- logrelrisk(eqdata)

p <- ae.dotplot(aed, A.name="TREATMENT A (N=216)",B.name="TREATMENT B (N=431)")
BenBarnes
  • 19,114
  • 6
  • 56
  • 74
  • then it gives following error Error in `$<-.data.frame`(`*tmp*`, "PCT", value = numeric(0)) : replacement has 0 rows, data has 34 Calls: logrelrisk -> $<- -> $<-.data.frame I m really stuck please help :( – henna Apr 12 '12 at 05:36
  • Ahhh... Now I see that one of your column names is incorrect. `SEA` should be `SAE`. Does that do it? (the `hh` line should still be taken out) – BenBarnes Apr 12 '12 at 06:06