Published on :
Statistical CREATION_INTERNE

Example 6 for PROC GLM - Romano-British Pottery

This code is also available in: Français
Awaiting validation
The script begins by setting a title for the output. Then, it creates a dataset named 'pottery' using inline data (datalines). This dataset contains information on the discovery site (Site) and the concentrations of several chemical elements (Al, Fe, Mg, Ca, Na). Finally, PROC GLM is used to perform a MANOVA. It specifies 'Site' as a classification variable and the chemical elements as dependent variables. A contrast is defined to compare the 'Llanederyn' site to the rest of the sites. The option 'manova h=_all_ / printe printh;' is used to request the printing of E and H matrices for all effects, which is essential for MANOVA interpretation.
Data Analysis

Type : CREATION_INTERNE


The data is created directly within the script via a DATA STEP block with DATALINES statements. It represents the chemical composition of pottery from different sites (Llanederyn, Caldicot, IslandThorns, AshleyRails) and their concentrations of Aluminum, Iron, Magnesium, Calcium, and Sodium.

1 Code Block
DATA STEP Data
Explanation :
This DATA STEP block creates a temporary dataset named 'pottery'. It defines the 'Site' variable (character of length 12) and the concentrations of chemical elements (Al, Fe, Mg, Ca, Na) as numeric. The data is then read directly from the subsequent lines via the DATALINES statement.
Copied!
1DATA pottery;
2 INPUT Site $12. Al Fe Mg Ca Na;
3 DATALINES;
4Llanederyn 14.4 7.00 4.30 0.15 0.51
5Llanederyn 13.8 7.08 3.43 0.12 0.17
6Llanederyn 14.6 7.09 3.88 0.13 0.20
7Llanederyn 11.5 6.37 5.64 0.16 0.14
8Llanederyn 13.8 7.06 5.34 0.20 0.20
9Llanederyn 10.9 6.26 3.47 0.17 0.22
10Llanederyn 10.1 4.26 4.26 0.20 0.18
11Llanederyn 11.6 5.78 5.91 0.18 0.16
12Llanederyn 11.1 5.49 4.52 0.29 0.30
13Llanederyn 13.4 6.92 7.23 0.28 0.20
14Llanederyn 12.4 6.13 5.69 0.22 0.54
15Llanederyn 13.1 6.64 5.51 0.31 0.24
16Llanederyn 12.7 6.69 4.45 0.20 0.22
17Llanederyn 12.5 6.44 3.94 0.22 0.23
18Caldicot 11.8 5.44 3.94 0.30 0.04
19Caldicot 11.6 5.39 3.77 0.29 0.06
20IslandThorns 18.3 1.28 0.67 0.03 0.03
21IslandThorns 15.8 2.39 0.63 0.01 0.04
22IslandThorns 18.0 1.50 0.67 0.01 0.06
23IslandThorns 18.0 1.88 0.68 0.01 0.04
24IslandThorns 20.8 1.51 0.72 0.07 0.10
25AshleyRails 17.7 1.12 0.56 0.06 0.06
26AshleyRails 18.3 1.14 0.67 0.06 0.05
27AshleyRails 16.7 0.92 0.53 0.01 0.05
28AshleyRails 14.8 2.74 0.67 0.03 0.05
29AshleyRails 19.1 1.64 0.60 0.10 0.03
30;
31 
2 Code Block
PROC GLM
Explanation :
This block uses the GLM procedure to perform a multivariate analysis of variance (MANOVA). The CLASS statement declares 'Site' as a categorical variable. The MODEL statement specifies that the element concentrations (Al, Fe, Mg, Ca, Na) are the dependent variables and that 'Site' is the explanatory variable. A CONTRAST is defined to test the effect of 'Llanederyn' against the three other combined sites. The MANOVA statement requests a MANOVA analysis for all model effects (`h=_all_`), with the display of hypothesis (H) and error (E) matrices (`printe printh`) for a detailed interpretation of the results.
Copied!
1PROC GLM DATA=pottery;
2 class Site;
3 model Al Fe Mg Ca Na = Site;
4 contrast 'Llanederyn vs. the rest' Site 1 1 1 -3;
5 manova h=_all_ / printe printh;
6RUN;
7 
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : /****************************************************************/ /* S A S S A M P L E L I B R A R Y */ /* */ /* NAME: GLMEX6 */ /* TITLE: Example 6 for PROC GLM */ /* PRODUCT: STAT */ /* SYSTEM: ALL */ /* KEYS: MANOVA */ /* PROCS: GLM */ /* DATA: */ /* */ /* REF: PROC GLM, EXAMPLE 6. */ /* MISC: */ /****************************************************************/


Banner
Expert Advice
Expert
Simon
Expert SAS et fondateur.
« In archaeometry, determining the origin of artifacts requires more than just looking at individual elements; it requires a holistic view of chemical "fingerprints." Using PROC GLM for MANOVA is the professional choice here because it analyzes the vector of concentrations (Al, Fe, Mg, Ca, Na) simultaneously, accounting for the correlations between these elements that individual ANOVAs would miss. »