ST 103-Statistical Applications I-2011/2012 Note 03: Code Data Values
ST 103-Statistical Applications I-2011/2012 Note 03: Code Data Values
Code Data Values Numeric to Numeric Manip Code Numeric to Text Text to Text Text to Numeric Syntax CODE (K...K) to K ... (K...K) to K for C...C, put in C...C Eg: MTB > CODE (-2 -1)0 c1 c2 c4 c5 This would code the values -2 and -1 in the columns C1 and C2 in to 0 and put in columns C4 and C5.
C1 2 -1 -2 -1 3 5 2 Eg:
C2 1 2 -1 -2 -2 3 2
C3
C4 2 0 0 0 3 5 2
C5 1 2 0 0 0 3 2
Add these data into C7 column of your work sheet 78, 50, 100, 15, 30, 42, 33, 95, 28, 70, 85, 55, 63, 90, 83, 17 If the value in C7 between 100 and 75 If the value in C7 between 74 and 65 If the value in C7 between 64 and 30 If the value in C7 between 29 and 0 Code as A and put in C8 Code as B and put in C8 Code as C and put in C8 Code as D and put in C8
MTB > CODE (100:75)"A" (74:65)"B" (64:30)"C" (29:0)D C7 C8 Doing Arithmetic operations with menu commands Using the calculator we can do arithmetic operations, comparison operations, logical operations, functional operations and column operations. Calc Calculator variable or constant
Doing Arithmetic operations with Let The LET command make it easy to do very complicated calculations. LET uses following symbols + For add For subtract * For multiply / For divide ** For raise to the power After applying an operation if that results a single number answer, we can store that number as a constant. Eg.
MTB > DATA> DATA> DATA> DATA> MTB > READ C1 C2 8 1 6 3 4 4 END LET C3=10*(C1+C2)
LET C4=10*C1+C2 LET C5=C1/C2+1 LET K1=3 LET K2=18 LET K3=K1+K2+4 LET C6=K1*C1 LET C7=C1**2 PRINT C1-C7 K1-K3