Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
ConstructCategoryMatrix (Read 1289 times)
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
ConstructCategoryMatrix
Sep 13th, 2006 at 5:46am
 
Dear Sergei,

How does the ConstructCategoryMatrix command work when the likelihood function uses more than one category variable? This is not clear from the documentation.

regards,
Konrad
Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: ConstructCategoryMatrix
Reply #1 - Sep 13th, 2006 at 8:07am
 
Dear Konrad,

If you have N category variables with C_1, ... C_N rate classes each, ConstructCategoryMatrix will generate a matrix with C_1 x C_2 ... x C_N rows and a column for each site. You can index into the column as you would into a normal multi-dimensional array in C, but using explicit indices. For example, for two category variables, to get the value for class i in variable 1 and class j in variable 2, you would use the index i*C_2 + j (assuming i and j are 0-based). For 3 variables:
i*C_2*C_3 + j*C_3 + k etc.

To determine the order for the category variables for indexing, you can call the function GetInformation (order_ID, lf_ID), and have the names of category variables stored in the matrix referred to by order_ID.

Cheers,
Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged