Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

how to use nlmefit to multilevel regression (mixed effect) model

Asked by Dimitar Atanasov

Dimitar Atanasov (view profile)

on 9 May 2013

I have the following data:

X - column vector of n predictor values

Y - column vector of n responses

G - column vector of n values defining group membership in one of g groups

The model to be fitted is

y_ij = b_0 + b_1*.x_i + u_j

The values y_ij are presented in the vector Y for the corresponding values of the vector X.

How can I arrange the calling the nlmefit function, especially FUN parameter.

0 Comments

Dimitar Atanasov

Dimitar Atanasov (view profile)

Products

No products are associated with this question.

1 Answer

Answer by the cyclist

the cyclist (view profile)

on 9 May 2013
Accepted answer

This answer

http://www.mathworks.com/matlabcentral/answers/44620-group-specific-predictors-in-nlmefit

has a toy example that I think will be helpful for you.

3 Comments

Dimitar Atanasov

Dimitar Atanasov (view profile)

on 9 May 2013

If fact it is not my case, or I cant figure out how to rearrange the things.

In my model

y_ij = b_0 + b_1*.x_i + u_j

b_0, b_1 and u_j (j = 1:g) are unknown parameters.

the cyclist

the cyclist (view profile)

on 9 May 2013

I'm afraid I can't code up your specific problem for you. I was hoping that the simple example that Tom posted would give you a hint.

There is also a thorough example in the documentation of nlmefit(). Have you looked it and tried to understand it?

http://www.mathworks.com/help/stats/nlmefit.html

Dimitar Atanasov

Dimitar Atanasov (view profile)

on 10 May 2013

Yes, of course. The first place that e look for solution was the documentation....

I'll try to manage the problem and I'll post the solution after that.

the cyclist

the cyclist (view profile)

Contact us