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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Help with Statistics: Linear Regression, Correlation, Confidence Interval

Hello everyone,

 

I have two columns of data that are somewhat correlated. My task here is to show that correlation, and to use it to predict future outcomes (e.g given X, what is y) as well as the margin of error.

First I plotted X and Y on the scatter visual, and added a trendline. Next I used the Correlation Coefficient quick measure which gave me -0.680.

Next I used this linear regression, so that a report user could choose X and see what the estimated Y value would be based on historical data.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Simple-Linear-Regression/td-p/247439

The regression model mirrors the trend line that Power BI produced.

 

2018-05-31_11-13-27.png

The last piece I want to include is a margin of error, or some degree of confidence. Here's where I need help (it's been a long time since I took statistics).

 

At first I thought I could take the standard deviation of the error (abs(EstimatedY-ActualY) for all rows, multiply by 1.96 for 95% confidence and add it to the mean error.  Say it's 0.06 for the sake of illustration.  Am I showing that 95% of the errors land within +- 0.06 of the trendline?

 

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Does the margin of error which calculated as you said satisfy your requirement?

What you are seeking for is to show the value of “margin of error” around a trendline?

 

Best Regards

Maggie

Anonymous
Not applicable

Yes, that's exactly what i am trying to calculate - the margin of error/confidence interval around the trendline.

Determining the margin of error for set of values (one variable) is simple...  what I don't understand is how to do for a trendline becauses there are two correlated values.

 

Any stats gurus who know how this can be done, please help 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.