[R] Summarising Data for Forrest Plots

Polwart Calum (County Durham and Darlington NHS Foundation Trust) calum.polwart at nhs.net
Wed Jul 29 19:06:00 CEST 2009


>> What I want to do is do a forrest (forest) plot for subgroups within my single dataset as a test of heterogeniety. I have a dataset who received either full dose(FD) or reduced dose(RD) treatment, and a number of characteristics about those subjects: age, sex, renal function, weight, toxicity.  And I have survival data (censored).  they are in standard columnar data.
>>
> Is there an *easy* way to transform them into something like this:
>>
>>         SubGroup        n.FD    n.RD    surv.FD         surv.RD
>> 1       Age >65
>> 2       Age <= 65
>> 3       Male
>> ...
>> 9       Grade 0-2 Tox
>> 10      Grade 3/4 Tox

>>
>Hi Calum,
>Have you tried subsetting the dataset like this:
>
>meta.DSL(...,data=mydataset[mydataset$age <= 65,],...)
>
>Jim

Hi Jim,

I'm not sure that I understand!  But my understanding was that meta.DSL wants 4 bits of information number treated (Full Dose in my case), Number in control (reduced dose in my case), Number of events in the twoi groups... which is what I was trying to describe above - although possibly not very well..

Then it will do the work for me.

My challenge is taking a load of data in columns and getting it summarised by the subgroups so that it takes Age > 65 and counts how many had full dose, howmany had reduced dose and populates the field then does the same for Age < 65 etc etc...  (I may be back with questions about the survival value - but even knowing how to get it to summarise like I describe would be a start.  I guess its a bit like a pivot table in excel?


But perhaps its something to do with the mydataset[mydataset$age <=65,] bit?  That seems to give me a data table with only the 65 and unders which makes sense.  But then how do I get it to populate a table with the numbers in the two groups?

********************************************************************************************************************

This message may contain confidential information. If yo...{{dropped:21}}




More information about the R-help mailing list