Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
KKahina
Contributor II
Contributor II

linear regression linest_m & linest_b

Hi everyone,

I want to draw a linear regression line , here are the details:

my dimension is:  if (([Classe Q206])<>'NC/NSP',[Q206])

and my measure is: Count(Q801a)/COUNT(TOTAL(Q801a))

can you please tell me what is the formula to draw my linear regression line ?

i  tried many formulas, but I didn't manage to do it

thank you in advance

 

Capture.PNG

 

Labels (4)
8 Replies
sunny_talwar

May be this

 

Linest_M(TOTAL Aggr(Count({<[Classe Q206]) -= {'NC/NSP'}>} Q801a)/Count(TOTAL {<[Classe Q206] -= {'NC/NSP'}>} Q801a), [Q206])) * [Q206]

+

Linest_B(TOTAL Aggr(Count({<[Classe Q206]) -= {'NC/NSP'}>} Q801a)/Count(TOTAL {<[Classe Q206] -= {'NC/NSP'}>} Q801a), [Q206]))

 

KKahina
Contributor II
Contributor II
Author

thank's a lot for your reponse, but it doesn't work either

sunny_talwar

Do you mind elaborating? What exactly do you mean when you say it doesn't work? Does it give 0? does it give an error? Does it not give you the line you expect to see? What exactly is wrong?

KKahina
Contributor II
Contributor II
Author

first it gives an error about the expression, then i removed the brackets after [classe Q206], after that the expression was OK,  but it doesn't give the regression line, it gives nothing.

sunny_talwar

Would you be able to share a sample so that we can see the issue?

KKahina
Contributor II
Contributor II
Author

can you please explain what do you mean by sample ?

sunny_talwar

Lol sample can mean a lot of things 😉. Just kidding.

All I am asking is for you to share something where I can see what you have and test the expression I gave and see it not working and then try to make few changes to see what works. Without knowing/seeing your data, it is difficult to give you a perfect expression which will work right away. So, it would be nice if you can share qvw/qvf.

I hope I make sense now?

KKahina
Contributor II
Contributor II
Author

i think it's clearer now lol 🙂

here is the data used to make the scatter plot, hope it what you asked for