# Naive question about Bayesian multivariate logistic regression

I am stuck on what's probably a trivial question. I am reading a paper about multivariate logistic regression, and they say:

let y_i = (y_i1,...,y_ip)  = vector of binary responses
let X_i be a (p x q) matrix of predictors

then (z_i1, ... ,z_ip)' ~ multivariate logistic(X_i * beta, E)


I am stuck because I don't understand how to make the predictors into a matrix of these dimensions. For example, suppose p = 3 and q = 5. My data will look something like:

(1 1 0)
(1 1 1)
....


and for each measurement I will have a row of 5 predictors, something like (X1 X2 X3 X4 X5). I don't understand how I can fashion this row into a 3 x 5 matrix. Could someone please help?

• $X$ is called a design matrix or model matrix. Follow the links to find hundreds of posts about them. – whuber Apr 15 '16 at 15:22
• I did, and I also did an extensive Google search. I can't seem to find a good answer to my question. – user3490622 Apr 15 '16 at 15:45
• Please tell us what would constitute a good answer. Currently your question is too vague and subjective to determine how to respond: it only asks "can someone please help (me understand)?" – whuber Apr 15 '16 at 15:56
• Just that - how can I possibly make my row of 5 predictors into a 3x5 matrix. To be precise: suppose I have a subject taking a test with 3 questions, and 1's mark the correct answers to each question. Suppose their answers are (1 0 1). Suppose also that my predictors are the subject's age, education, gender, race, and ethnicity. So I need to do (1 0 1) = (???) (age education gender race ethnicity) * (coefficients). The question is, what's ??? that transforms a 5-column vector of predictors into a 3x5 matrix. – user3490622 Apr 15 '16 at 17:09
• How many subjects do you have? – whuber Apr 15 '16 at 18:19

Here, p is the number of observations/subjects you have, and q is the number of predictors you have. Each of the p subjects you observe will give q values of predictor variables, so you end up with a p x q matrix of predictors from all your subjects.

So if you have a 3 x 5 matrix, that means you observed information from 3 subjects, and each subject gave you information on 5 predictor variables.

subject 1 [ X11 X12 X13 X14 X15 ]
subject 2 [ X21 X22 X23 X24 X25 ]
subject 3 [ X31 X32 X33 X34 X35 ]


Edit: Based on what I see in the paper, a key thing you should mention in your question is that it's Bayesian multivariate logistic regression. The answers and comments you have received so far do not consider that framework.

Anyway, your example is the following:

To be precise: suppose I have a subject taking a test with 3 questions, and 1's mark the correct answers to each question. Suppose their answers are (1 0 1). Suppose also that my predictors are the subject's age, education, gender, race, and ethnicity.

Now, your X matrix will depend on whether or not the subject's predictor values have changed in the time they took the test. Your X matrix for a particular subject will look like this:

subject 1 [ X11 X12 X13 X14 X15 ]
[ X21 X22 X23 X24 X25 ]
[ X31 X32 X33 X34 X35 ]

X11 is subject 1's age when he/she answers the 1st question
X21 is subject 1's age when he/she answers the 2nd question
X31 is subject 1's age when he/she answers the 3rd question

X12 is subject 1's education when he/she answers the 1st question
X22 is subject 1's education when he/she answers the 2nd question
X32 is subject 1's education when he/she answers the 3rd question


And so on. So if none of subject 1's predictor values changed in the time between he/she answers all the questions, then you would have all 3 rows look the same.

• Thanks Sheep, but I am afraid that's not quite it. I have hundreds of subjects, and 3 is the number of responses I get from each subject. Supposedly, for each subject I can construct a 3x5 matrix of predictors, and that's what I don't get. – user3490622 Apr 15 '16 at 19:07
• For each subject you observe 3 responses and 5 predictors, correct? – Sheep Apr 15 '16 at 19:10
• @user3490622 Could you post a link to the paper you are referring to? – Sheep Apr 15 '16 at 19:43
• Yeah, here it is citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.12.8901 – user3490622 Apr 15 '16 at 19:58
• Alright, I think I have the answer to your example now. – Sheep Apr 15 '16 at 21:05