You are on page 1of 17

STATISTICAL

STATISTICAL PACKAGES
PACKAGES
COURSE TEACHER
S. A. AHSAN RAJON
COMPUTER SCIENCE AND ENGINEERING DISCIPLINE,
KHULNA UNIVERSITY, KHULNA.
EMAIL: ahsan.rajon@gmail.com
WEB: www.cseku.ac.bd/rajon
www.rajon.forumerzone.com
Topics

† COMPUTING VARIABLES
COMPUTE NEW VARIABLE FROM EXISTING

† It is possible to compute a new variable from one


or more existing variables.
† For example, we may define a new variable
gpa_1_2 which will contain the average ygpa of 1st
year and 2nd year.
† That is,
„ Gpa_1_2 = (y1_gpa + y2_gpa) / 2
COMPUTE NEW VARIABLE FROM EXISTING

† For the overall purpose, Go to


† Transform -> compute
COMPUTE NEW VARIABLE FROM EXISTING

Select the operands from the variable list and use the operator
buttons as you need in the Compute Variable Window
COMPUTE NEW VARIABLE FROM EXISTING

† HAVE A LOOK….
COMPUTING VARIABLES
† BASIC COMMAND:
„ NEW VARIABLE = MATHEMATICAL EXPRESSION

† SPSS mathematical expression may include


arithmetic operators:
„ + Addition
„ - Subtraction
„ * Multiplication
„ / Division
„ ** Exponential
COMPUTING VARIABLES
† Mathematical Expression may also contain
functions.
„ Arithmetic Functions
„ Statistical Functions
„ Logical Functions
COMPUTING VARIABLES
† Arithmetic Function
„ LG10
† 10 base Logarithm
„ Eg. lginc= LG10(inc)
„ Calculate logarithm of inc and store into variable lginc
„ LN
† Base e logarithm
„ Eg. lgeinc= LN(inc)
„ Calculate e-based logarithm of inc and store into variable
lgeinc
COMPUTING VARIABLES
† STATISTICAL FUNCTION
„ SUM
† Calculate Summation
† totinc = SUM(basic, hsrent,bonus)
„ MEAN
† Calculate mean i.e. average.
† avgmark = MEAN(mark1 TO mark5)
† MEAN is used to calculate the average of mark1, mark2,
mark3, mark4, mark5.
† The keyword TO can be used to indicate that variables (in
order they are found in the file) in between the two
named in the command should be included.
COMPUTING VARIABLES
† LOGICAL FUNCTIONS
„ Logical functions evaluate as TRUE or FALSE.
„ If TRUE, new computed variable will be given the value 1.
„ If FALSE, new computed variable will be given the value 0.
† ANY
„ spsscrs = ANY (course, CSE1100, CSE2251, CSE3251, CSE3255)
† RANGE
„ passed = RANGE (marks, 40, 100)
„ A new variable named passed will be created where, marks with
values more than 40 and less than 100 will be displayed as 1 and
all other cases (< 40) will be presented as 0
COMPUTING VARIABLES
† Here is a look.
† Initially we have this statistics
COMPUTING VARIABLES
† GO to
„ TRANSFROM
† COMPUTE
COMPUTING VARIABLES
† Here is the
Expression
† Passesd
† =
† RANGE (marks, 40,
100)

† Click on OK.
COMPUTING VARIABLES
† Ya….
† We get
that…
COMPUTING VARIABLES
† Now
customize
that
according to
this look….
† But HOW
????
„ Its up to
you….
COMPUTING VARIABLES

THANKS !!!

You might also like