etirm::ItemRespCounts Class Reference

Class to hold counts of number of examinees who responded in each response category of an item. More...

#include <swig_etirm.h>

List of all members.

Public Member Functions

 ItemRespCounts (int ncat, int ngroup)
 Class constructor.
virtual ~ItemRespCounts ()
 Deconstructor.
void AddResponse (int respIndex, Real count, int group)
 Increments counts based on item response.
Real RespCount (int group)
 Returns total number of responses to item.
RealVector CategoryCounts (int group)
 Returns number of responses in each response category.

Protected Attributes

RealVector totalCount
 Total number of examinees who have responses for the item.
RealMatrix catCounts
 Number of responses in each response category.


Detailed Description

Class to hold counts of number of examinees who responded in each response category of an item.

Definition at line 74 of file swig_etirm.h.


Constructor & Destructor Documentation

etirm::ItemRespCounts::ItemRespCounts ( int  ncat,
int  ngroup 
) [inline]

Class constructor.

Function Parameters

Parameters:
[in] ncat Number of response categories for the item.
[in] ngroup Number of examinee groups.

Definition at line 87 of file swig_etirm.h.

00087                                          :
00088       catCounts(ngroup+1, ncat, 0.0), totalCount(ngroup+1, 0.0)
00089     {
00090     }

virtual etirm::ItemRespCounts::~ItemRespCounts (  )  [inline, virtual]

Deconstructor.

Definition at line 93 of file swig_etirm.h.

00094     {
00095     }


Member Function Documentation

void etirm::ItemRespCounts::AddResponse ( int  respIndex,
Real  count,
int  group 
)

Increments counts based on item response.

Function Parameters

Parameters:
[in] respIndex "One" offset index corresponding to response to increment count for (1 = first response category, 2 = second response category, etc.).
[in] count Amount to increment counts.
[in] group Group to increment counts for (1, 2, ...).

Definition at line 121 of file swig_etirm.cpp.

References catCounts, and totalCount.

00122   {
00123 
00124     if (respIndex > catCounts.size() || respIndex < 1)
00125     {
00126       throw InvalidArgument("Invalid response index", "ItemRespCounts::AddResponse");
00127     }
00128 
00129     totalCount[0] += count; // total count
00130     totalCount[group] += count; // count for group
00131 
00132     catCounts(1, respIndex) += count; // total count
00133     catCounts(group+1, respIndex) += count; // count for group
00134   }

Real etirm::ItemRespCounts::RespCount ( int  group  )  [inline]

Returns total number of responses to item.

Function Parameters

Parameters:
[in] group Group(1, 2, ...) for which counts are to be returned.
Note: group = 0 returns counts across all groups.

Definition at line 111 of file swig_etirm.h.

References totalCount.

00112     {
00113       return totalCount[group];
00114     }

RealVector etirm::ItemRespCounts::CategoryCounts ( int  group  )  [inline]

Returns number of responses in each response category.

Function Parameters

Parameters:
[in] group Group(1, 2, ...) for which counts are to be returned.
Note: group = 0 returns counts across all groups.

Definition at line 126 of file swig_etirm.h.

References catCounts.

Referenced by etirm::item_cat_counts().

00127     {
00128       return RealVector(catCounts.begin_row(group+1), catCounts.begin_row(group+1)
00129           +catCounts.num_columns());
00130     } // ww: Edit "num_cols" -> "num_columns", 1/8/2008.

Here is the caller graph for this function:


Member Data Documentation

RealVector etirm::ItemRespCounts::totalCount [protected]

Total number of examinees who have responses for the item.

totalCount[0] is total count across all groups totalCount[i], i>0, is count for group i

Definition at line 141 of file swig_etirm.h.

Referenced by AddResponse(), and RespCount().

RealMatrix etirm::ItemRespCounts::catCounts [protected]

Number of responses in each response category.

Columns give counts for response categories Row 1 gives counts across all groups. Row i, i>1, gives counts for group i-1.

Definition at line 151 of file swig_etirm.h.

Referenced by AddResponse(), and CategoryCounts().


The documentation for this class was generated from the following files:
Generated on Sat Mar 1 21:41:57 2008 for ETIRM by  doxygen 1.5.4