1

I am quite new to R statistics, and I one you can help me. I have tried finding the answer to my question by searching the forum and so on, and I apologize in advance if my question is trivial or stupid.

I have spent the last month collecting my first data set. And my dataset is now ready to be analyzed. I have spent some time learning the most basic function of the R statistics.
My dataset deals with adverse drug reaction reports. Each report may contain several suspect drugs and several adverse reactions. A case can therefore contain several drugs and adverse reaction (drug-ADR) combinations. Some cases contain just one combination and others contain several.

And now my question is: How do I make calculations that are “case-specific”? I want to calculate a Completeness Score for the percentage of completed data fields for each drug-ADR combination, and then I would like to calculate the average for the entire case/report.

I want to calculate a Completness Score (C) for each drug-ADR combination expressed as: C = (1-Pi) = (1-P1) x (1-P 2) x (1-P3) …. (1-Pn) , where Pi refers to the penalty deducted, if the data field is not complete (ex 0.50 for 50%). If the information is not missing the panalty 0. The max score will then be 1. n is the number of parameters / variables.

Ultimately I want to calculate an overall Completness score for the overall case/report. The total score is should be calculated from the average of each drug-ADR combination. C = Cj / m , where j denotes the current drug-ADR combination, and m is the total number of combinations of drug-ADR in the full report.

Can anyone help me?

Thanke you for your attention!! I will be very grateful for any help that I can get.

  • If I understood your question well, you could start with taking a look at the plyr package. – Wave Oct 01 '14 at 12:08
  • 2
    Welcome to SO. Please read [this](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) : 1- simple data example 2- the expected output 3- what have so far tried. – agstudy Oct 01 '14 at 12:08
  • 1
    Post here a small sample of your data-set. If it has been read to a data.frame, use head(data_frame_name) command to get a sample. – rnso Oct 01 '14 at 12:29

0 Answers0