-1

I am doing meta-analysis between 2 arms using meta package and used subset if number of events are available in all comparison arms but I got weird results (NA in some cells) then I tried to investigate the cause using the following code

data$Studlab<- as.factor(data$Studlab)
show<- cbind(Studlab,IMA.number.of.grafts.TOTAL, IMA.MGF.overall,IMA.MGF.overall.SD, Venous.TOTAL.number.of.grafts,     Venous.MGF.overall, Venous.MGF.overall.SD);show

It gave me numbers instead of authors in studlab column enter image description here

Original column is as follow

enter image description here

My original dataset is gigantic. Any advice is greatly appreciated.

Mohamed Rahouma
  • 1,084
  • 9
  • 20

1 Answers1

0

It would be that the column is factor (based on the first line of code)

data$Studlab<- as.factor(data$Studlab)

we can change it to character and it should work or better would be to use data.frame instead of cbind (as cbind returns a matrix and matrix can have only single type. There is a strong possibility that the factor is coerced to integer storage mode while cbinding with the rest of the columns that are just numeric).

data.frame(Studlab,IMA.number.of.grafts.TOTAL, IMA.MGF.overall,IMA.MGF.overall.SD, Venous.TOTAL.number.of.grafts,     Venous.MGF.overall, Venous.MGF.overall.SD)

Note clear whether the OP is attaching the data.frame which would be a bad option. There are ways to subset the columns (with or $ or [[) instead of attach

akrun
  • 874,273
  • 37
  • 540
  • 662
  • Thanks . I tried `data$Studlab<- as.character(data$Studlab)` and repeated the `cbind` but did not work BUT `show<- data.frame(Studlab,IMA.number.of.grafts.TOTAL, IMA.MGF.overall,IMA.MGF.overall.SD, Venous.TOTAL.number.of.grafts, Venous.MGF.overall, Venous.MGF.overall.SD);show` works. Appreciate. – Mohamed Rahouma Sep 06 '19 at 15:40