+ Reply to Thread
Results 1 to 4 of 4

Grouping data acording to a table comparing each other and attribute a letter

  1. #1
    Registered User
    Join Date
    05-18-2013
    Location
    suisse
    MS-Off Ver
    Excel 2003
    Posts
    3

    Grouping data acording to a table comparing each other and attribute a letter

    Hi everyone!
    I'm totally blocked with this...
    I trying to group my sample according to a table comparing each other one by one and i'd like to make a function or a macro so the sample will be grouped together if they are not different from each other and a letter is attributed to each sample depending on the group it belong.
    I'd really appreciate some help i'm trying to do this for quite a long time now!

    I've put attached an exemple of the table the function should use and how i'd like it look afterward
    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-30-2013
    Location
    France
    MS-Off Ver
    2010
    Posts
    260

    Re: Grouping data acording to a table comparing each other and attribute a letter

    Please be more explicit about what you are trying to achieve.

    Si t'es plus à l'aise en français, poste ta question dans le sous-forum "non-anglais".

  3. #3
    Registered User
    Join Date
    05-18-2013
    Location
    suisse
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Grouping data acording to a table comparing each other and attribute a letter

    If you look the .xlsx i attached, you'll see on the top a table with the summary of an ANOVA. What i'd like to do is to summaries all this comparisons done one by one by grouping the samples which have no significant differences between them together. and i'd like those group to be named with letters from a to z (with the possibility that a sample belong to multiple group in the same time). The goal is that i can use those letters (group name) to use them into a chart to show the ANOVA result in the label of each bar of my chart. I hope it's more clear. Thanks a lot for helping!!

  4. #4
    Registered User
    Join Date
    05-18-2013
    Location
    suisse
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Grouping data acording to a table comparing each other and attribute a letter

    I don't know if it helps but i think the function who does that in "R" is the following but since i wasn't able to understand it i was not able to do the same in vba



    > order
    function (..., na.last = TRUE, decreasing = FALSE)
    {
    z <- list(...)
    if (any(unlist(lapply(z, is.object)))) {
    z <- lapply(z, function(x) if (is.object(x))
    xtfrm(x)
    else x)
    if (!is.na(na.last))
    return(do.call("order", c(z, na.last = na.last, decreasing = decreasing)))
    }
    else if (!is.na(na.last))
    return(.Internal(order(na.last, decreasing, ...)))
    if (any(diff(sapply(z, length)) != 0L))
    stop("argument lengths differ")
    ans <- sapply(z, is.na)
    if (is.list(ans))
    return(integer(0L))
    ok <- if (is.matrix(ans))
    !apply(ans, 1, any)
    else !any(ans)
    if (all(!ok))
    return(integer(0L))
    z[[1L]][!ok] <- NA
    ans <- do.call("order", c(z, decreasing = decreasing))
    keep <- seq_along(ok)[ok]
    ans[ans %in% keep]
    }

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1