









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Examples of basic matrix manipulations and case studies using the iml procedure in sas. It includes selecting rows and columns, summing over rows and columns, creating matrices, and reading and writing sas data sets. Two case studies are presented: estimating pi using monte carlo integration and implementing a randomization test.
Typology: Study notes
1 / 15
This page cannot be seen from the preview
Don't miss anything!










2x3 example matrix C = {1 2 3,4 5 6} = 1 2 3 4 5 6 C_R
2x3 example matrix C = {1 2 3,4 5 6} = 1 2 3 4 5 6 C 1x3 column sums of C = C[+,] = 5 7 9 C 2x1 row sums of C = C[,+] = 6 15 F extract 2nd column of C into new vector (F) = C[,2] = 2 5 D put 2nd column of C into a diagonal matrix (D) = DIAG(C[,2]) = 2 0 0 5 CC convert diagonal (of D) into vector (CC) = VECDIAG(D) = 2 5 Column bind C with itself yielding E = C||C = E
Row bind C with vector of 2's (F) = C // SHAPE(2,1,3) = 1 2 3 4 5 6 2 2 2 K 6x6 matrix = 1 2 3 1 2 3 4 5 6 4 5 6 1 2 3 1 2 3 4 5 6 4 5 6 1 2 3 1 2 3 4 5 6 4 5 6
row_sum = 6 15 G 3 + 3*(col2&3)^3 (G) = 27 84 378 651
Display 10.8: IML plot of the total young vs. nitrofen concentration data Plot of #young vs. conc 40 ˆ ‚ ‚ ‚ ‚ * * 35 ˆ * ‚ * ‚ * * ‚ * * ‚ * * * 30 ˆ * * ‚ * * N ‚ u ‚ * * * * m ‚ * * b 25 ˆ e ‚ * r ‚ * * ‚ o ‚ * f 20 ˆ ‚ y ‚ o ‚ * u ‚ * n 15 ˆ * * g ‚ ‚ * ‚ * ‚ 10 ˆ ‚ ‚ ‚ * * ‚ * 5 ˆ * ‚ * ‚ ‚ ‚ 0 ˆ * ‚ ‚ ‚ Šƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒ 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 Nitrofen concentration print of data constructed in IML
PI-estimate = 3.19 0.025416 3.1391679 3.
The solution to x-√3=0 is x= 1.732… , i.e. √3=1.732, as we see in Display 10.12. This display also includes the iteration history of this bisection method. We see that the convergence criterion of 10
is achieved in iteration number 26. Display 10.12: Iteration history from using the method of bisection to estimate √ 3
MID
Obs ITERATION LOW HIGH 1 0 0.00000 3. 2 1 1.50000 3. 3 2 1.50000 2. 4 3 1.50000 1. 5 4 1.68750 1. 6 5 1.68750 1. 7 6 1.68750 1. 8 7 1.71094 1. 9 8 1.72266 1. 10 9 1.72852 1. 11 10 1.73145 1. 12 11 1.73145 1. 13 12 1.73145 1. 14 13 1.73181 1. 15 14 1.73199 1. 16 15 1.73199 1. 17 16 1.73204 1. 18 17 1.73204 1. 19 18 1.73204 1. 20 19 1.73205 1. 21 20 1.73205 1. 22 21 1.73205 1. 23 22 1.73205 1. 24 23 1.73205 1. 25 24 1.73205 1. 26 25 1.73205 1.
Estimating PI using MC simulation methods with 400 data points PI_EST SE_EST PI_LCL PI_UCL 3.29 0.0764183 3.1371635 3. Estimating PI using MC simulation methods with 1600 data points PI_EST SE_EST PI_LCL PI_UCL 3.16 0.0407308 3.0785384 3. Estimating PI using MC simulation methods with 4000 data points PI_EST SE_EST PI_LCL PI_UCL 3.15 0.0258723 3.0982554 3.