SlideShare uma empresa Scribd logo
1 de 5
Baixar para ler offline
1
Data Manipulation and Data Management
Day 1, Session IV
M. Amir Hossain, Ph.D.
January 17, 2016
Transformation Expressions
Arithmetic Operations: Following arithmetic operators
are available:
 + Addition.
 - Subtraction.
 * Multiplication.
 / Division.
 ** Exponentiation.
2
Transformation Expressions
 No two operators can appear consecutively.
 Arithmetic operators cannot be implied. For example,
(VAR1)(VAR2) is not a legal specification; you must specify
VAR1*VAR2.
 To improve readability, blanks (not commas) can be inserted
before and after an operator.
 To form complex expressions, you can use variables, constants,
and functions with arithmetic operators.
Transformation Expressions
The order of execution is functions first, then
exponentiation, then multiplication, division, and
unary, and then addition and subtraction.
Operators at the same level are executed from left to
right.
To override the order of operation, use parentheses.
Execution begins with the innermost set of
parentheses and progresses out.
3
A relation is a logical expression that compares two values using
a relational operator. Relational operators are:
 EQ or = Equal to.
 NE or ~= ¬ = or <> Not equal to.
 LT or < Less than.
 LE or <= Less than or equal to.
 GT or > Greater than.
 GE or >= Greater than or equal to.
Relational Operators
Data Manipulation Commands
COMPUTE
• COMPUTE target variable = expression
Overview
• COMPUTE creates new numeric variables or modifies the
values of existing variables. The variable named on the left of
the equal sign is the target variable. The variables, constants,
and functions on the right side of the equal sign form an
assignment expression.
4
Data Manipulation Commands
Examples
•
• COMPUTE INCREMENT=SALARY-SALBEGIN.
• EXECUTE.
• COMPUTE PINCREM=(INCREMENT/SALBEGIN)*100.
• EXECUTE.
• COMPUTE RAISE=SALARY*0.12.
• EXECUTE.
• COMPUTE NEWSAL1 = SALARY + SALARY*0.10
• EXECUTE.
• COMPUTE NEWSAL2 = SALARY + SALBEGIN*0.10 + EDUC*10
• EXECUTE.
RECODE
RECODE varlist (value list =value)...(value list=value) [INTO varlist] [/varlist...]
Input keywords: LO, LOWEST, HI, HIGHEST, THRU, MISSING, SYSMIS,
ELSE
Output keywords: COPY, SYSMIS
Overview:
• RECODE changes, rearranges, or consolidates the values of an existing
variable. RECODE can be executed on a value-by-value basis or for a
range of values. Where it can be used, RECODE is much more efficient
that the series of IF commands that produce the same transformation.
With RECODE, you must specify the new values.
5
INTO keyword
INTO specifies a target variable to receive recoded values from the original , or
source variables. Source variable remain unchanged after the recode.
INTO must follow the value specification for the source variables that are being
recoded in to the target variables.
The number of target variable must equal the number of source variables.
Example
RECODE SALARY (LO THRU 50000=1)(50001 THRU 75000=2)(75001 THRU HI=3)
INTO SALCAT1.
EXECUTE.

Mais conteúdo relacionado

Mais procurados

Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
Learnbayin
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statement
Eyelean xilef
 

Mais procurados (16)

Opeartor &amp; expression
Opeartor &amp; expressionOpeartor &amp; expression
Opeartor &amp; expression
 
R operators
R   operatorsR   operators
R operators
 
Python operators
Python operatorsPython operators
Python operators
 
Operators
OperatorsOperators
Operators
 
C++ Expressions Notes
C++ Expressions NotesC++ Expressions Notes
C++ Expressions Notes
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Chapter 7: Arithmetic and Relational Operators
Chapter 7:  Arithmetic and Relational Operators Chapter 7:  Arithmetic and Relational Operators
Chapter 7: Arithmetic and Relational Operators
 
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Use of Linear Regression in Machine Learning for Ranking
Use of Linear Regression in Machine Learning for RankingUse of Linear Regression in Machine Learning for Ranking
Use of Linear Regression in Machine Learning for Ranking
 
Python Operators
Python OperatorsPython Operators
Python Operators
 
2 r algebra
2 r algebra2 r algebra
2 r algebra
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statement
 
Operator precedence and associativity
Operator precedence and associativityOperator precedence and associativity
Operator precedence and associativity
 

Destaque

Lal nil bipabali ba bangla shahityer jibani by humayun azad (allbanglaboi.blo...
Lal nil bipabali ba bangla shahityer jibani by humayun azad (allbanglaboi.blo...Lal nil bipabali ba bangla shahityer jibani by humayun azad (allbanglaboi.blo...
Lal nil bipabali ba bangla shahityer jibani by humayun azad (allbanglaboi.blo...
Md.Mahamud hasan
 

Destaque (20)

Herramientas para el mantenimiento del pc
Herramientas para el mantenimiento del pc Herramientas para el mantenimiento del pc
Herramientas para el mantenimiento del pc
 
Para instalar software
Para instalar softwarePara instalar software
Para instalar software
 
Los 10 Mandamientos De La Informatica
Los 10 Mandamientos De La InformaticaLos 10 Mandamientos De La Informatica
Los 10 Mandamientos De La Informatica
 
Beane James 040816
Beane James 040816Beane James 040816
Beane James 040816
 
Herramientas web 2
Herramientas web 2Herramientas web 2
Herramientas web 2
 
Lal nil bipabali ba bangla shahityer jibani by humayun azad (allbanglaboi.blo...
Lal nil bipabali ba bangla shahityer jibani by humayun azad (allbanglaboi.blo...Lal nil bipabali ba bangla shahityer jibani by humayun azad (allbanglaboi.blo...
Lal nil bipabali ba bangla shahityer jibani by humayun azad (allbanglaboi.blo...
 
Tecnico en sistemas
Tecnico en sistemasTecnico en sistemas
Tecnico en sistemas
 
PRODUCCIÓN Y DESARROLLO SUSTENTABLE
PRODUCCIÓN Y DESARROLLO SUSTENTABLEPRODUCCIÓN Y DESARROLLO SUSTENTABLE
PRODUCCIÓN Y DESARROLLO SUSTENTABLE
 
Dispositivos de interconexión
Dispositivos de interconexiónDispositivos de interconexión
Dispositivos de interconexión
 
herramientas del sistema
herramientas del sistemaherramientas del sistema
herramientas del sistema
 
My CV (1)
My CV (1)My CV (1)
My CV (1)
 
PROPIEDADES DEL ARANDANO
PROPIEDADES DEL ARANDANOPROPIEDADES DEL ARANDANO
PROPIEDADES DEL ARANDANO
 
El diesel una amenaza
El diesel una amenazaEl diesel una amenaza
El diesel una amenaza
 
Resumen sobre el sena
Resumen sobre el senaResumen sobre el sena
Resumen sobre el sena
 
How to be an Emergency doctor
How to be an Emergency doctorHow to be an Emergency doctor
How to be an Emergency doctor
 
Candidate MA
Candidate MACandidate MA
Candidate MA
 
Paint
PaintPaint
Paint
 
La Communication digitale dans l'industrie musicale
La Communication digitale dans l'industrie musicaleLa Communication digitale dans l'industrie musicale
La Communication digitale dans l'industrie musicale
 
Evolución De Los Sistemas Operativos
Evolución De Los Sistemas Operativos Evolución De Los Sistemas Operativos
Evolución De Los Sistemas Operativos
 
Corso di implantologia 10-11 marzo 2017
Corso di implantologia 10-11 marzo 2017Corso di implantologia 10-11 marzo 2017
Corso di implantologia 10-11 marzo 2017
 

Semelhante a SPSS

E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
Mukund Trivedi
 
E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)
Mukund Trivedi
 
E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)
Mukund Trivedi
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
bajiajugal
 
Chapter 3.3
Chapter 3.3Chapter 3.3
Chapter 3.3
sotlsoc
 

Semelhante a SPSS (20)

Operator
OperatorOperator
Operator
 
c programming2.pptx
c programming2.pptxc programming2.pptx
c programming2.pptx
 
Operation and expression in c++
Operation and expression in c++Operation and expression in c++
Operation and expression in c++
 
Operators in java presentation
Operators in java presentationOperators in java presentation
Operators in java presentation
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
 
E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)
 
E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Operator precedence and associativity
Operator precedence and associativityOperator precedence and associativity
Operator precedence and associativity
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
This slide contains information about Operators in C.pptx
This slide contains information about Operators in C.pptxThis slide contains information about Operators in C.pptx
This slide contains information about Operators in C.pptx
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 
Operators in java script
Operators   in  java scriptOperators   in  java script
Operators in java script
 
Coper in C
Coper in CCoper in C
Coper in C
 
Data Transformation
Data TransformationData Transformation
Data Transformation
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
OPERATORS OF C++
OPERATORS OF C++OPERATORS OF C++
OPERATORS OF C++
 
C# operators
C# operatorsC# operators
C# operators
 
Chapter 3.3
Chapter 3.3Chapter 3.3
Chapter 3.3
 

Mais de Abir Hossain

Mais de Abir Hossain (20)

Communication
CommunicationCommunication
Communication
 
Disciplinary action
Disciplinary actionDisciplinary action
Disciplinary action
 
Communication process
Communication processCommunication process
Communication process
 
Barrier of women entrepreneurs pdf
Barrier of women entrepreneurs pdfBarrier of women entrepreneurs pdf
Barrier of women entrepreneurs pdf
 
Srq costing exercise-solving
Srq costing exercise-solvingSrq costing exercise-solving
Srq costing exercise-solving
 
Srq costing exercise problem
Srq costing exercise problemSrq costing exercise problem
Srq costing exercise problem
 
Srq on decision making
Srq on decision makingSrq on decision making
Srq on decision making
 
Srq 5 p analysis
Srq 5 p analysisSrq 5 p analysis
Srq 5 p analysis
 
Program schedule
Program scheduleProgram schedule
Program schedule
 
Pre test
Pre testPre test
Pre test
 
Post test
Post testPost test
Post test
 
Concept note bpp
Concept note bppConcept note bpp
Concept note bpp
 
Case study swot analysis
Case study swot analysisCase study swot analysis
Case study swot analysis
 
Case study pecs
Case study pecsCase study pecs
Case study pecs
 
Bankable business proposal format
Bankable business proposal formatBankable business proposal format
Bankable business proposal format
 
BSTI Certification Course
BSTI Certification Course BSTI Certification Course
BSTI Certification Course
 
BSTI Certification Course
BSTI Certification Course BSTI Certification Course
BSTI Certification Course
 
Cm licensening system
Cm licensening systemCm licensening system
Cm licensening system
 
010 effective presentations skills
010 effective presentations skills010 effective presentations skills
010 effective presentations skills
 
Srq decision making
Srq decision makingSrq decision making
Srq decision making
 

Último

Último (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

SPSS

  • 1. 1 Data Manipulation and Data Management Day 1, Session IV M. Amir Hossain, Ph.D. January 17, 2016 Transformation Expressions Arithmetic Operations: Following arithmetic operators are available:  + Addition.  - Subtraction.  * Multiplication.  / Division.  ** Exponentiation.
  • 2. 2 Transformation Expressions  No two operators can appear consecutively.  Arithmetic operators cannot be implied. For example, (VAR1)(VAR2) is not a legal specification; you must specify VAR1*VAR2.  To improve readability, blanks (not commas) can be inserted before and after an operator.  To form complex expressions, you can use variables, constants, and functions with arithmetic operators. Transformation Expressions The order of execution is functions first, then exponentiation, then multiplication, division, and unary, and then addition and subtraction. Operators at the same level are executed from left to right. To override the order of operation, use parentheses. Execution begins with the innermost set of parentheses and progresses out.
  • 3. 3 A relation is a logical expression that compares two values using a relational operator. Relational operators are:  EQ or = Equal to.  NE or ~= ¬ = or <> Not equal to.  LT or < Less than.  LE or <= Less than or equal to.  GT or > Greater than.  GE or >= Greater than or equal to. Relational Operators Data Manipulation Commands COMPUTE • COMPUTE target variable = expression Overview • COMPUTE creates new numeric variables or modifies the values of existing variables. The variable named on the left of the equal sign is the target variable. The variables, constants, and functions on the right side of the equal sign form an assignment expression.
  • 4. 4 Data Manipulation Commands Examples • • COMPUTE INCREMENT=SALARY-SALBEGIN. • EXECUTE. • COMPUTE PINCREM=(INCREMENT/SALBEGIN)*100. • EXECUTE. • COMPUTE RAISE=SALARY*0.12. • EXECUTE. • COMPUTE NEWSAL1 = SALARY + SALARY*0.10 • EXECUTE. • COMPUTE NEWSAL2 = SALARY + SALBEGIN*0.10 + EDUC*10 • EXECUTE. RECODE RECODE varlist (value list =value)...(value list=value) [INTO varlist] [/varlist...] Input keywords: LO, LOWEST, HI, HIGHEST, THRU, MISSING, SYSMIS, ELSE Output keywords: COPY, SYSMIS Overview: • RECODE changes, rearranges, or consolidates the values of an existing variable. RECODE can be executed on a value-by-value basis or for a range of values. Where it can be used, RECODE is much more efficient that the series of IF commands that produce the same transformation. With RECODE, you must specify the new values.
  • 5. 5 INTO keyword INTO specifies a target variable to receive recoded values from the original , or source variables. Source variable remain unchanged after the recode. INTO must follow the value specification for the source variables that are being recoded in to the target variables. The number of target variable must equal the number of source variables. Example RECODE SALARY (LO THRU 50000=1)(50001 THRU 75000=2)(75001 THRU HI=3) INTO SALCAT1. EXECUTE.