marginal.table: Create a Marginal Table

Description Usage Arguments Value See Also Examples

Description

The marginal.table function is used to summarize only the positive responses (joint positive responses for multiple MRCVs) for data arising from one, two, or three MRCVs. This function essentially provides a subset of counts from the item.response.table function.

Usage

1

Arguments

data

A data frame containing the raw data where rows correspond to the individual item response vectors, and columns correspond to the items W1, ..., WI, Y1, ..., YJ, and Z1, ..., ZK (in this order).

I

The number of items corresponding to row variable W. I = 1 for the one MRCV case.

J

The number of items corresponding to column variable Y.

K

The number of items corresponding to strata variable Z.

Value

The marginal.table function uses the tabular function (package tables) to produce a table containing positive counts.

See Also

The item.response.table function for creating an item response table or data frame that summarizes both the positive and negative responses for each (Wi, Yj) pair (conditional on the response for each Zk in the case of three MRCVs).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Create a marginal table for 1 MRCV
farmer.mtable.one <- marginal.table(data = farmer1, I = 1, J = 5) 
farmer.mtable.one

# Create a marginal table for 2 MRCVs
farmer.mtable.two <- marginal.table(data = farmer2, I = 3, J = 4) 
farmer.mtable.two

# Create a marginal table for 3 MRCVs
farmer.mtable.three <- marginal.table(data = farmer3, I = 3, J = 4, K = 5) 
farmer.mtable.three

Example output

                                                                        
       Y1             Y2             Y3             Y4             Y5   
   n   count   %      count   %      count   %      count   %      count
 1 88  19    21.59    38    43.18    29    32.95    47    53.41    40   
 2 16   2    12.50     6    37.50     8    50.00     8    50.00     4   
 3 31   1     3.23    13    41.94    10    32.26    17    54.84    14   
 4 113 19    16.81    29    25.66    40    35.40    53    46.90    29   
 5 14   3    21.43     4    28.57     8    57.14     6    42.86     6   
         
         
   %     
 45.45   
 25.00   
 45.16   
 25.66   
 42.86   
                                                               
    y1             y2             y3             y4            
    count   %      count   %      count   %      count   %     
 w1 27    9.68     16    5.73     2     0.72     2     0.72    
 w2 22    7.89     12    4.30     1     0.36     1     0.36    
 w3 19    6.81      6    2.15     1     0.36     0     0.00    
$z1
                                                               
    y1             y2             y3             y4            
    count   %      count   %      count   %      count   %     
 w1 6     2.15     4     1.43     0     0.00     0     0.00    
 w2 6     2.15     3     1.08     0     0.00     0     0.00    
 w3 5     1.79     2     0.72     0     0.00     0     0.00    

$z2
                                                               
    y1             y2             y3             y4            
    count   %      count   %      count   %      count   %     
 w1 10    3.58     8     2.87     1     0.36     1     0.36    
 w2  8    2.87     6     2.15     1     0.36     1     0.36    
 w3  6    2.15     3     1.08     1     0.36     0     0.00    

$z3
                                                               
    y1             y2             y3             y4            
    count   %      count   %      count   %      count   %     
 w1 8     2.87     5     1.79     2     0.72     0     0.00    
 w2 6     2.15     4     1.43     1     0.36     0     0.00    
 w3 6     2.15     3     1.08     1     0.36     0     0.00    

$z4
                                                               
    y1             y2             y3             y4            
    count   %      count   %      count   %      count   %     
 w1 10    3.58     8     2.87     1     0.36     1     0.36    
 w2  8    2.87     6     2.15     1     0.36     0     0.00    
 w3  7    2.51     3     1.08     1     0.36     0     0.00    

$z5
                                                               
    y1             y2             y3             y4            
    count   %      count   %      count   %      count   %     
 w1 6     2.15     7     2.51     1     0.36     0     0.00    
 w2 6     2.15     5     1.79     1     0.36     0     0.00    
 w3 4     1.43     3     1.08     1     0.36     0     0.00    

MRCV documentation built on May 2, 2019, 3:46 a.m.