+ Reply to Thread
Results 1 to 4 of 4

Select certain cells in matrix to assign a 0-1 or 1-0 dyad 10,000 times

  1. #1
    Registered User
    Join Date
    02-23-2010
    Location
    Canada, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Unhappy Select certain cells in matrix to assign a 0-1 or 1-0 dyad 10,000 times

    Hello everyone and thank you for reading my plea for help!
    I am a research student trying to calculate the linearity of a certain number of individuals (the subjects of my study).

    In my matrix of individuals I have the row individuals dominant to column individuals given values of 1, and where individuals in the column are dominant to those in the row, a value of 0 is given. Where the relationships are "tied" a value of 0.5 is entered. I have more than 30 unknown relationships, which I have filled with "x".

    What I have to do, is select these x-cells (Haha, Excels :P) and randomly insert a 1-0 or 0-1 dyad between the corresponding individuals. So if (in the data file) Garth and Nala are to have a 1-0 or 0-1 inserted to their corresponding cells, but they must be opposite; like if row-Garth gets a 1 on column-Nala, then column-Garth gets a 0 on row-Nala.
    I have highlighted (in the second matrix) all of the non-x cells. I have to make 10,000 matrices (or at least replicate the application of these random 1-0/0-1 dyads 10,000 times).

    I am attaching my matrix file, and also a word file describing what I am trying to be doing after this is managed, as I have to calculate a particular equation after as well...
    And I have to do all of these steps 10,000 in order to satisfy probability requirements.

    I hope that someone will be able to help me!

    Thank you so much everyone for your time taken to read this, and time taken in attempting to help me solve this problem
    Attached Files Attached Files
    Last edited by LaraCat; 03-02-2010 at 08:27 PM. Reason: Accidentally hit enter while entering tags...

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Select certain cells in matrix to assign a 0-1 or 1-0 dyad 10,000 times

    I think Excel is well suited to solving this, but am not sure I understand the problem.

    In the upper matrix of the attachment, your original data is in the UR triangle. The LL triangle uses a simple UDF to convert the corresponding value in the UR, changing 1 to 0 and 0 to 1, and leave everything else ("x" and 0.5) as is. A formula at right computes h for the matrix (2.032)

    In the lower matrix, the UR triangle gets the values from the upper matrix, except for values which are x; for those, it randomly choose 0 or 1. The LL triangle uses the same function as the upper matrix. The formula again computes h for this matrix.

    The problem is, h is much lower for the lower matrix when all the x's of the upper matrix are replaced with 1s or 0s; it's in the neigborhood of 0.1.

    If you can explain what's going wrong, I'll try to help fix it.

    EDIT: This isn't an attempt to solve the iteration thing, just a step to understanding the problem.
    Attached Files Attached Files
    Last edited by shg; 02-27-2010 at 08:19 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-23-2010
    Location
    Canada, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Select certain cells in matrix to assign a 0-1 or 1-0 dyad 10,000 times

    Ok, I took a look at the file, thanks for your work so far!

    What I am trying to do, is change the 'x' values, where they are, into either 1's or 0's.
    So, for the pair Garth and Lara, for example, they have not interacted once during my study (hence the x - for unknown relationship).
    This procedure (once repeated thousands of times, apparently) is a rough attempt to determine what their winning:losing relationship would be. So, by randomly assigning 1 or 0 to the first cell (rowGarth, colLara, for example) then the corresponding opposite would have to be entered into colGarth, rowLara - to express the winning-losing aspect of this dyad...
    In the next round (of the 10,000 repetitions) it could be a 1 or 0 in either spot again..
    And this has to be repeated for each x-pair (and there are many :S)

    The 1s and 0s, and 0.5s already present in the excel file are known winning-losing relationships (based on my data); the 1s indicate that the row individual is dominant to the column individual. The 0s mean that the column individual was dominant to the row individual.

    So, the x's need to be replaced with these numbers (0s or 1s) and then the formula calculated.
    and I need to be able to automate it so that it can be done 10,000 times (for probability purposes).

    Does that help a bit?

    EDIT: I should mention that the second matrix in the file I originally attached to this message (with the yellow highlighting) was for my own ease of understanding just how many x's I had going on...and an attempt at excel functions of cell-colours, etc... But they are otherwise identical.

    Second EDIT: Alright, upon reviewing the literature again, I've found that I have to calculate the h-value for the matrix I am observing, then randomly change all the dyad values again (to 1-0, 0-1s) and then calculate the new h, to compare to the old h (from the previous matrix).
    I need to calculate how many times the new h is greater than or equal to the old h...
    I am going to include the URL for the article (page 9/15 is where it starts talking about what I am trying to do). Find the step-by-step instructions under "An Improved Test of Linearity".

    http://www.biol.ruu.nl/behaviour/deV...eVries1995.pdf


    Thank you so much!!!
    Last edited by LaraCat; 03-01-2010 at 04:47 AM.

  4. #4
    Registered User
    Join Date
    02-23-2010
    Location
    Canada, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Select certain cells in matrix to assign a 0-1 or 1-0 dyad 10,000 times

    Thank you everyone for your views, and to shg for the help!

    I have a few people in real life who have been able to help me!

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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