[R] R suitability for development project

Eric Langley eric at abeo.us
Mon Sep 3 15:18:00 CEST 2012


Jim wrote:

> I would use mean ranks for something like this. You would have to calculate
> these from your summary array unless you have the raw ranks.

I note:
Thank you for the detailed answer.
I have the raw ranks. For a question they look like this; 1=Item2,
2=Item1, 3=Item3, 4=Item4

Jim wrote:
> ranksumm2meanranks<-function(x,nobs) {
>  nitems<-dim(x)[1] - 1
>  meanrankvec<-rep(0,nitems)
>  for(rankrow in 1:nitems) {
>   for(rankcol in 1:nitems)
>    meanrankvec[rankrow]<-
>     meanrankvec[rankrow]+x[rankrow,rankcol]*rankcol
>   meanrankvec[rankrow]<-
>    meanrankvec[rankrow]/x[rankrow,nitems+1]
>  }
>  names(meanrankvec)<-rownames(x)[-1]
>  return(meanrankvec)
> }
>
>> ranksumm2meanranks(x)
>    Item2    Item3    Item4   Totals
> 1.571429 1.642857 2.857143 3.928571

I note:
Is it possible to have the output as an integer where 99 is the highest score?

Jim wrote:

> Your explanation of the plot is not entirely clear. The ranges of the ranks
> for the items are:
>
> Item1 c(1,2)
> Item2 c(1,3)
> Item3 c(1,4)
> Item4 c(3,4)
>
> You could plot these as horizontal bars spanning the range of the ranks for
> each item with a vertical line across each bar showing the value of the mean
> rank for that item. This would illustrate both the relative position and
> variability of ranks, something like a boxplot.
>
> In case you have incomplete ranks, check the crank package for completion of
> incomplete ranks.

I note:
The look I am aiming to achieve (as shown here:
http://community.abeo.us/sample-graphs/ ) is a relative position
within the middle zero based horizontal axis. The mean is not
required. Since all bars are 14 units long the upper and lower values
note where the end of each bar should align, either to the right for
Highest or to the left for Lowest. The third graph shows both.

~eric



On Mon, Sep 3, 2012 at 7:41 AM, Jim Lemon <jim at bitwrit.com.au> wrote:
> Eric Langley wrote:


>> An array of rank ordered data looks like this:
>> Item-Rank First Second Third Fourth Totals
>> Item1 6 8 0 0 14
>> Item2 7 5 2 0 14
>> Item3 1 1 11 1 14
>> Item4 0 0 1 13 14
>> Totals 14 14 14 14
>>
>> The required output of R will be two fold;
>>
>> 1, a numerical score for each of the Items (1-4) from highest to
>> lowest and lowest to highest on a scale of 0-99 that is statistically
>> accurate. For this example the scores would be Item1 highest number
>> down to Item4 with the lowest number. In reverse Item4 would be the
>> highest number down to Item1 the lowest number. For the Highest like
>> this; Item1=94, Item2=88, Item3=48, Item4=2 (just guessing here on the
>> scores...:)
>>
>> 2, a graphical output of the data based on the scores in three special
>> graphs with a middle line at '0' and increasing numbers to the left
>> AND right. The graphs plot the Highest ranked Items, the Lowest Ranked
>> items and a combination of the two.
>> Sample graphs are here: http://community.abeo.us/sample-graphs/
>>
>> Looking forward to hearing if R will be able to accomplish this.


-- 
Eric Langley
Founder


eric at abeo.us
404-326-5382




More information about the R-help mailing list