Non- Analysis By Chanaka Kaluarachchi

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Presentation outline

• Linear regression

• Checking linear Assumptions

• Linear vs non-linear

• Non linear

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Linear regression (reminder)

• Linear regression is an approach for modelling dependent variable(푦) and one or more explanatory variables (푥).

푦 = 훽0 + 훽1푥 + 휀 Assumptions: 휀~푁(0, 휎2 ) – iid ( independently identically distributed)

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Checking linear Assumptions

iid- residual plot (휀 푣푠 푦 ) can be inspect to check that assumptions are met.

• Constant - Scattering is a constant magnitude

• Normal - few outliers, systematic spared above and below the axis

• Liner relationship- No curve in the residual plot

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Residual plot in SPSS

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Residual plots in SPSS

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Linear vs non linear

Linear

• Linear • No curves in residual plot • Correlation between variable is significant

Non-linear

• Curves in scatter plot • Curves in residual plot • No significant correlation between variables

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Non linear regression

• Non linear regression arises when predictors and response follows particular function form.

푦 = 푓 훽, 푥 + 휀

Examples

푦 = 훽2푥 + 휀 - non linear 푦 = 훽푥2 + 휀 - linear

1 1 푦 = 푥 + 휀 - non linear 푦 = 훽 + 휀 - linear 훽 푥 푦 = 푒훽푥 + 휀 - non linear 푦 = 훽 ln 푥 + 휀 - linear

1 푦 = + 휀 - non linear 1+훽푥

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Transformation

• Some nonlinear regression problems can be moved to a linear domain by a suitable transformation of the model formulation.

• Four common transformations to induce linearity are: logarithmic transformation, square root transformation, inverse transformation and the square transformation

Examples

• 푦 = 푒훽푥 ln 푦 = 훽푥 if 푦 ≥ 0

1 1 • 푦 = − 1 = 훽푥 if 푦 ≠ 0 1+훽푥 푦

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Curve Estimation

Curve fitting is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points.

Example – Viral growth model

• An internet service provider (ISP) is determining the effects of a virus on its networks. As part of this effort, they have tracked the (approximate) percentage of e-mail traffic on its networks over time, from the of discovery until the threat was contained.

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Curve Estimation- Cont.

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Output

Scatter plot P value< 0.05 means model is significant Higher the 푅2 better the model fit

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Segmentation

We can split the graph in to segments and fit a segmented model. Example – Viral growth model

We can fit a logistic equation for the first 19 hours and an asymptotic regression for the remaining hours should provide a good fit and interpretability over the entire time period.

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Logistic model and choosing starting values

훽1 푦 = −훽 푥 1 + 훽2푒 3

Starting values

• 훽1- upper value of growth (0.65)

• 훽2- ratio upper value and lowest value (0.65/0.13=5)

• 훽3- estimated slop between points in plot. (0.6-0.12/19-3)=0.03

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Asymptotic regression model

휃3푥 푦 = 휃1 + 휃2푒

Starting values

• 휃1- lowest value (0)

• 휃2- difference upper value and lowest value (0.6)

• 훽3- estimated slop between points in plot. (0.6-0.1/20-40)=-0.025

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Output

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Output

Research in Pharmacoepidemiology (RIPE) @ National School of Pharmacy, University of Otago Thanks for listening

ResearchResearch in Pharmacoepidemiology in Pharmacoepidemiology (RIPE) @ National (RIPE) School @ of Pharmacy,National UniversitySchool of of Pharmacy,Otago University of Otago