Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

R2 value for a plot

I have 2 variables in my dataset and want to know how well a regression without intercept fits the data.

I predict Y by using X

so my regression formula is Y= B*X

Using Linear regression.

The measurement for the goodness of the fit is the R2.

the formula for R2=

1-(RRerr/RRtot)

see: http://en.wikipedia.org/wiki/Coefficient_of_determination

I understand the concept of regression and the formula of R2, but I can's seem to get this working in qlikview.

Anyone know how?

see trial dataset in attachment

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You may want to take a look into the linest_XXXX function sets (search the Help for statistical aggregation functions in charts).

So maybe

=LINEST_R2(y,x)

is what you are looking for?

View solution in original post

7 Replies
swuehl
MVP
MVP

You may want to take a look into the linest_XXXX function sets (search the Help for statistical aggregation functions in charts).

So maybe

=LINEST_R2(y,x)

is what you are looking for?

Not applicable
Author

Your answer works thanks!


I was trying to type the whole formula for R2 myself... too tricky to make mistakes...

The only problem I still have is the following:

I want a regression without a constant.

So I figured you should type linest_r2(y,x,0).

However, this doesn't work. Neither does linest_r2(y,x,'0').

linest_r2(y,x) works though. But I guess this is the R2 of a regression of y=mx + b and not y=mx

swuehl
MVP
MVP

In this case, I think linest_r2(y,x,0) should be used. This is also what the help says.

Specifying the y0 does work with other linest functions, if it does not work with linest_r2, I have no clue yet.

Not applicable
Author

no it does not work for linest_r2 (anyway, not in my file).

the trial dataset is attached with my first post...

swuehl
MVP
MVP

I'll be offline for a few days.

If feasible, you may want to contact support, I think this could be a bug, it's not working as described (in the Help).

I could maybe Help you in rebuilding (like you initially tried) the expression, but not before mid of next Week.

jansen28
Contributor III
Contributor III

Hi Kenneth, I'm working on the linest_r2 calculation. I'm using the below formula to calculate r2.

where,

vmindate = 12/30/2013

vgetfield = 06/01/2014

=LINEST_R2({<Date = {'>=$(vmindate) <=$(=vgetfield)'}>}x,y)

I get null value. Does Linest_r2 works in qlikview or Am I using incorrect calculations.

I appreciate your help Kenneth....

Regards,

Jan

Anonymous
Not applicable
Author

Hi Janani,

Were you able to get value using  LINEST_R2() with date condition.