Excel 산점도(Excel scatter plot ) 에 선형 회귀 추세선을 추가하는 방법을 검색 했거나 제목을 보고 " 이 단어가 영어 (English)입니까(Are) ?!" 라고 생각했기 때문에 이 글을 읽고 있는 것입니다. 둘 다 도와드리겠습니다.
선형 회귀란 무엇입니까?(What Is Linear Regression?)
선형 회귀 추세선이 무엇인지 안다면 건너뛰십시오. 좋아, 이제 괴상한 사람들이 사라졌으니 선형 회귀에 대해 설명하겠습니다. 선형(Linear ) 은 한 줄을 의미합니다. 당신은 그것을 알고 있었다. 수학에서 회귀(Regression) 는 한 가지가 다른 것에 얼마나 의존하는지 알아내는 것을 의미합니다. 우리는 이 두 가지 를 X 와 Y 라고 부를 것 입니다.
몇 년 동안 주식 시장에서 단일 주식의 가치를 추적하는 예를 들어 보겠습니다. X는 년 단위의 시간이고 Y는 달러 단위의 값입니다.
주식의 가치는 무엇보다도 시간의 흐름에 따라 변한다는 것을 알고 있습니다. 우리는 다른 것들을 통제할 수 없지만 주식을 매도할 때 통제할 수 있으므로 시간 변수를 통제합니다. 그러나 시간이 지남에 따라 주식의 가치는 얼마나 의존적입니까?
1달러에 주식을 샀는데 1년 만에 그 가치가 100달러까지 올랐다면, 그 가치는 매년 100달러씩 더 오를 것이라는 뜻입니까? 25년 후에 가치가 $2500가 될 것이라는 의미입니까? 우리는 모른다.
우리는 주식이 몇 년 동안 얼마나 벌었는지 살펴봄으로써 그것을 알아냅니다. 한 가지 또는 한 가지 변수를 변경하는 정도만 측정하기 때문에 매우 간단 합니다. (simple)그런 다음 그 측정값을 그래프나 플롯(plot) 에 넣습니다 . 점이 여기저기에 있거나 흩어져(scattered) 있을 수 있습니다 .
추세를 나타내는 점을 통해 선을 그릴 수 있습니까? 이것을 추세선(trendline) 이라고 합시다 . 예, 확실히 시도할 수 있습니다. 그 선은 산점도를 통한 단순 선형 회귀 추세선(simple linear regression trendline through a scatter plot) 입니다. 이제 우리는 그 단어들이 실제로 영어이고 그 의미를 압니다. Excel 에서 하나를 만들어 보겠습니다 .
선형 회귀 추세선을 사용하여 Excel 산점도를 만드는 방법(How To Create An Excel Scatter Plot With Linear Regression Trendline)
아직 Excel에 대해 모두 배우지(learned all about Excel) 않았다고 가정해 보겠습니다 . 첫 번째 단계는 산점도를 만드는 것입니다. 그런 다음 추세선을 만들 수 있습니다. 그런 다음 추세선으로 몇 가지 깔끔한 작업을 수행하고 그것이 의미하는 바를 확인할 수 있습니다.
(Create 2)Excel 에서 2개의 데이터 열을 만듭니다 . 우리의 예에는 시간(Time) (년)과 주식 가치(Stock Value) (달러)가 있습니다. 데이터를 Excel에 복사하여 붙여넣을(copy and paste the data into Excel) 수 있으므로 함께 플레이할 수 있습니다. 그런 다음 Excel 에서 왼쪽 상단 숫자를 선택하고 누른 상태에서 오른쪽 열의 맨 아래 숫자로 끌어서 두 데이터 열을 모두 선택합니다.
Time (Yrs)
Stock Value ($)
2000
1498
2001
1160
2002
1147
2003
848
2004
1126
2005
1180
2006
1294
2007
1420
2008
1322
2009
797
2010
1169
2011
1325
2012
1408
2013
1569
2014
1872
2015
2067
2016
2059
2017
2362
2018
2640
2019
2834
2020
2584
기본 도구 모음에서 삽입(Insert ) 을 선택 합니다.
점만 있는 그래프 아이콘을 찾으십시오. 옆에 있는 아래쪽 화살표를 선택합니다.
점만 있고 선이 없는 첫 번째 산점도 그래프를 선택합니다.
그래프가 작성되고 Excel 차트(customized the Excel chart) 를 원하는 대로 사용자 정의했으면 단일 데이터 포인트를 마우스 오른쪽 버튼으로 클릭합니다. 이것은 약간 까다로울 수 있으므로 첫 번째 시도에서 이해하지 못하면 계속 시도하십시오. 그렇게 하면 하위 메뉴가 열립니다.
추세선 추가(Add Trendline) 를 선택 합니다 .
형식 추세선(Format Trendline) 메뉴가 오른쪽에 열립니다 . 선형(Linear ) 추세선 옵션 이 이미 선택되어 있습니다. 그대로 두십시오. 선이 멋지게(Feel) 보이도록 Excel 서식(Excel formatting) 으로 자유롭게 작업하세요 . 이제 20년 동안 주식 가치의 일반적인 성장을 보여주는 선형 회귀 추세선이 생겼습니다.
(Want)2030년의 가치가 무엇인지 알고 싶으십니까 ? 앞으로 예측(Forecast Forward) 필드 의 추세선에 10개의 기간 또는 연도를 추가하여 대략적인 아이디어를 얻을 수 있습니다 . 녹색 원의 점으로 약 $2500의 가치가 있음을 보여줍니다.
차트를 스마트하게 보이게 하려면 추세선 형식(Format Trendline) 메뉴 에서 아래로 스크롤하고 차트에 수식 표시(Display Equation on chart) 및 차트에 R-제곱 값 표시를(Display R-squared value on chart) 선택 합니다. 아래 빨간색 상자에 있는 것과 같은 항목이 차트에 표시되는 것을 볼 수 있습니다.
방정식과 R-제곱 값은 무엇을 의미합니까?(What Does The Equation and R-squared Value Mean?)
이것들은 있으면 편리합니다. R-제곱 값은 추세선 적합도가 얼마나 좋은지 알려줍니다. 0.8 이상의 R-제곱 값이 이상적이지만 0.69도 나쁘지 않습니다. 이 라인이 이 주식의 성과 경향에 대한 좋은 통찰력을 제공할 것이라고 69% 확신한다고 생각하십시오.
방정식을 사용하면 추세선의 주식 가치가 어느 시점에 있는지 파악하기 위해 빠른 계산을 더 쉽게 수행할 수 있습니다. 줄이 시작되기 전과 끝난 후에도 마찬가지입니다. 2030년 주식의 가치는? 방정식에 대입해 봅시다.
Y = 80.468 x X – 160136 – 여기서 X 는 2030 입니다.(2030)
Y = 80.468 x 2030 – 160136
Y = 163,350.04 – 160136
Y = 3,214.04
예, 추세가 유지된다면 해당 주식의 가치는 2030년에 $3214.04가 될 가능성이 있습니다.
선형 회귀 추세선으로 무엇을 할 것인가?(What Will You Do With A Linear Regression Trendline?)
Excel 의 선형 회귀 추세선 이 재정적 결정을 내리는 데 어떻게 도움이 되는지에 대한 예를 보여 드렸습니다. 그러나 다른 어떤 방법으로 사용할 수 있습니까? 아이디어가 떠오르시나요 ? (Are)알려주십시오.
Add a Linear Regression Trendline to an Excel Scatter Plot
You’re either reading this because you searchеd for how to add a lіnear regresѕion trendlinе tо an Excel scatter plot or you saw the title and thought, “Are these words even English?!” We’ll help you with both.
What Is Linear Regression?
If you know what a linear regression trendline is, skip ahead. Ok, now that the nerds are gone we’ll explain linear regression. Linear means in a line. You knew that. Regression, in math, means figuring out how much one thing depends on another thing. We’ll call these two things X and Y.
Let’s use the example of tracking the value of a single share in the stock market over the years. X will be time in years and Y will be the value in dollars.
We know that the value of a stock is changed by time passing, among other things. We can’t control those other things, but we can control when we sell the stock, so we control the time variable. But how dependent is the value of a stock on time passed?
If we bought a stock for $1 and in one year its value went up to $100, does that mean every year the value will go up another $100? Does that mean in 25 years it will be valued at $2500? We don’t know.
We figure it out by looking at how much the stock earned over several years. That’s fairly simple because we’re only measuring how much we change one thing or one variable. Then we put those measurements on a graph or plot. The dots could be all over the place or scattered.
Could we draw a line through the dots that would show a trend? Let’s call that a trendline. Yes, we can certainly try. That line is a simple linear regression trendline through a scatter plot. Now we know those words are actually English and what they mean. Let’s create one in Excel.
How To Create An Excel Scatter Plot With Linear Regression Trendline
Let’s assume you haven’t learned all about Excel yet. The first step is to create a scatter plot. Then we can create the trendline. Then we can do some neat things with the trendline and see what it means.
Create 2 columns of data in Excel. Our example will have Time in years and Stock Value in dollars. You can copy and paste the data into Excel so you can play along. Then, in Excel, select both columns of data by selecting and holding on the top-left number and dragging down to the bottom-most number in the right column.
Time (Yrs)
Stock Value ($)
2000
1498
2001
1160
2002
1147
2003
848
2004
1126
2005
1180
2006
1294
2007
1420
2008
1322
2009
797
2010
1169
2011
1325
2012
1408
2013
1569
2014
1872
2015
2067
2016
2059
2017
2362
2018
2640
2019
2834
2020
2584
Select Insert in the main toolbar.
Look for the icon of a graph with just dots on it. Select the down arrow next to it.
Select the first scatter graph with just dots and no lines.
Once the graph is built and you’ve customized the Excel chart to look the way you want it, right-click on a single data point. This can be a little tricky, so keep trying if you don’t get it on the first try. When you do, a sub-menu will open.
Select Add Trendline.
The Format Trendline menu will open on the right. The Linear trendline option will already be selected. Leave that as it is. Feel free to work with the Excel formatting to make the line look nice. Now you have a linear regression trendline that shows you the general growth of the stock value over 20 years.
Want to know what it will be worth in 2030? You can get a rough idea by adding 10 periods, or years, to the trendline in the Forecast Forward field. It will show that it’s valued at somewhere around $2500 by the dot in the green circle.
If you want your chart to make you look smart, scroll down in the Format Trendline menu and check Display Equation on chart and Display R-squared value on chart. You’ll see something like what’s in the red box below appear on your chart.
What Does The Equation and R-squared Value Mean?
These are handy to have. The R-squared value tells you just how good the trendline fit is. Although an R-squared value above 0.8 is ideal, 0.69 isn’t bad though. Think of it as you being 69% confident that this line will give you a good insight into how this stock tends to perform.
The equation makes it easier for you to do quick calculations to figure out what the stock value on the trendline is at any point in time. Even before the line begins and after it ends. What might the stock be worth in 2030? Let’s plug it into the equation.
Y = 80.468 x X – 160136 – where X is 2030
Y = 80.468 x 2030 – 160136
Y = 163,350.04 – 160136
Y = 3,214.04
Yes, if the trend holds, the value of the stock has a decent chance of being worth $3214.04 in 2030.
What Will You Do With A Linear Regression Trendline?
We’ve shown you an example of how a linear regression trendline in Excel might help you make a financial decision. But what other ways could you use it? Are you coming up with ideas? Let us know.
저는 Windows 11 및 10 플랫폼에서 10년 이상의 경험을 가진 소프트웨어 엔지니어입니다. 저는 Windows 7과 Windows 8을 위한 고품질 소프트웨어를 개발하고 유지 관리하는 데 중점을 두었습니다. 또한 Chrome, Firefox, Xbox One 및 파일을 포함하되 이에 국한되지 않는 다양한 다른 프로젝트에서도 작업했습니다.