## Visualize trends in data

*Click on the Link: *Visualize trends in data

*Click on the Link:*Visualize trends in data

As we know, the Ordinary Least Squares (OLS) assumption that “model should be linear in parameter” applies to parameters not on the variable, e.g., Y = α + β1X +e and Y = α + β1X + β2X2 preceding is linear in variables while following is non-linear in a variable, since it is non-linear in variable but linear in parameters, so OLS still estimates it. However, if the functional form of regression the equation is non-linear then we need to apply non-linear form like TP = 6L2 – 0.4L3, TP is total productivity of labor and L is many laborers used in production.

**Various forms of non-linear Forms**

- U shape inverted curve (it has peak) or U shape non-inverted curve (it has trough)

- If B1 > 0, B2 < 0 {it is U shape inverted curve (it has peak)}
- If B2 < 0, B1 > 0 {it is U shape non-inverted curve (it has trough)}

Exponential Growth like, y = B1 X B2 + Ut we can transform it by taking log both sides of the equation. Since the log form equation has already been discussed in the previous report of the Log in Regression Model, we will concentrate on the U shape inverted curve.

We have already discussed the different patterns of trends in Patterns and Trends in Data, therefore, trend lines help to use the proper functional form. R is a statistical computing and graphics language and environment. It is a GNU project that is similar to the S language and environment created by John Chambers and colleagues at Bell Laboratories (formerly AT&T, now Lucent Technologies).

R may be thought of as a more advanced version of S. Although there are some significant variations, most of the code written for S works in R without modification. R has a wide range of statistical and graphically extensible methodologies (linear and nonlinear modeling, classical statistical tests, time-series analyses, classification, clustering,).

The S programming language is often used for statistical methodology analysis, and R offers an Open-Source option for getting involved. Therefore, with the help of “R” software, and the Integrated Development Environment (IDE) of RStudio & Shiny, we can visualize the trends of stocks. You have to choose the ticker of the stock from Yahoo Finance and input it into the box Symbol, just as in this example by default SPDR S&P 500 ETF Trust (SPY) that can be replaced to any stock.

You can visualize any other symbol available on Yahoo Finance, like gold price, crude oil price, US treasury bills rate, and many more. You can change the starting and ending dates and click on the following to access real-time stock graphs.