Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transformations. Transformation (re-expression) of a Variable A very useful transformation is the natural log transformation Transformation of a variable.

Similar presentations


Presentation on theme: "Transformations. Transformation (re-expression) of a Variable A very useful transformation is the natural log transformation Transformation of a variable."— Presentation transcript:

1 Transformations

2 Transformation (re-expression) of a Variable A very useful transformation is the natural log transformation Transformation of a variable can change its distribution from a skewed distribution to a normal distribution (bell-shaped, symmetric about its centre For any value of x, ln(x) can be: Looked up in tables Calculated by most calculators Calculated by most statistical packages

3 Graph of ln(x)

4 The effect of the transformation

5 The effect of the ln transformation It spreads out values that are close to zero Compacts values that are large

6 Transforming data to a normal distribution allows one to use powerful statistical procedures (discussed later on) that assumes the data is normally distributed.

7 Transformations to Linearity Many non-linear curves can be put into a linear form by appropriate transformations of the either – the dependent variable Y or –the independent variable X –or both. This leads to the wide utility of the Linear model. Another use of trans

8 Intrinsically Linear (Linearizable) Curves 1 Hyperbolas y = x/(ax-b) Linear form: 1/y = a -b (1/x) or Y =  0 +  1 X Transformations: Y = 1/y, X=1/x,  0 = a,  1 = -b

9 2. Exponential y =  e  x =  x Linear form: ln y = ln  +  x = ln  + ln  x or Y =  0 +  1 X Transformations: Y = ln y, X = x,  0 = ln ,  1 =  = ln 

10 3. Power Functions y = a x b Linear from: ln y = lna + blnx or Y =  0 +  1 X Transformations: Y = ln y, X = ln x,  0 = lna,  1 = b

11 Summary Transformations can be useful for: 1.Changing data from a skewed distribution to a Normal (bell- shaped) distribution 2.Straightening out Non-linear data 3.A common transformation is the natural log transformation ln(x)

12 Example – Motor Vehicle Data The data is in an Excel file – MtrVeh.xls Dependent = mpg Independent = Engine size, horsepower and weight

13 The data in an SPSS file

14 We will try to fit a model predicting mpg with Engine (engine size). First a scatter plot: The dialog box selecting the variables:

15 The scatter-plot

16 Similar to: 2. Exponential y =  e  x =  x Linear form: ln y = ln  +  x = ln  + ln  x or Y =  0 +  1 X Transformations: Y = ln y, X = x,  0 = ln ,  1 =  = ln 

17 To perform a ln transformation in SPSS Go to the menu Transform->Compute

18 In this dialogue box you define the tansformation Press OK and the trasformation will be performed

19 The new variable has been added to the SPSS spreadsheet

20 The scatterplot showing a better fit to a straight line using the new variable lnmpg.

21 Transformations summary Transformations can be used to convert non-normal data to normally (bell-shaped) distributed data (allowing for the use of the more powerful techniques assuming normality) Transformations can be used to convert non-linear data linear (straight line) data.

22 Next topic Probability


Download ppt "Transformations. Transformation (re-expression) of a Variable A very useful transformation is the natural log transformation Transformation of a variable."

Similar presentations


Ads by Google