Results 1 to 2 of 2

statistical problem: building orthogonal contrasts in excel ( pairwise mean comparison)

Threaded View

  1. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: statistical problem: building orthogonal contrasts in excel ( pairwise mean comparison

    Macro code.
    A4 is set as starting cell, can be changed
    Sub GroupMatrix()
    
    Dim Startrng As Range
    Dim TA As Long, TB As Long, NoGrps As Long, X As Long
    
    Set Startrng = Range("A4")
    NoGrps = Val(InputBox("Enter number of Groups: "))
    
    Startrng = "GROUP A"
    Startrng.Offset(0, 1) = "GROUP B"
    
    X = 1
        For TB = 1 To NoGrps - 1
        Startrng.Offset(0, TB + 1) = "C" & TB
        Y = 1
            For TC = TB To NoGrps - 1
            Startrng.Offset(X, 0) = TB
            Startrng.Offset(X, TB + 1) = 1
            
            Startrng.Offset(X, 1) = TB + Y
            Startrng.Offset(X, TB + Y + 1) = -1
            
            X = X + 1
            Y = Y + 1
            
            Next TC
        
        Next TB
    
    With Startrng.CurrentRegion
        .HorizontalAlignment = xlCenter
        .Borders.LineStyle = xlContinuous
        .SpecialCells(xlCellTypeBlanks) = 0
    End With
    
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Building a selection tool - problem with the range
    By japie123 in forum Excel General
    Replies: 5
    Last Post: 09-09-2014, 10:39 AM
  2. Building a Comparison tool... possible?
    By txguyg in forum Excel General
    Replies: 10
    Last Post: 12-20-2013, 06:57 AM
  3. Replies: 1
    Last Post: 11-26-2013, 11:55 AM
  4. Macro for calculating pairwise rolling correlations
    By TrueTears in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-10-2013, 06:53 AM
  5. Problem with Statistical UDFs
    By pablocampbell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2005, 09:10 AM
  6. problem about building a listbox from another list
    By liangxin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2005, 09:28 PM
  7. Statistical problem
    By kalas123 in forum Excel General
    Replies: 2
    Last Post: 05-07-2005, 11:26 AM

Tags for this Thread

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