Published on :
Statistical INTERNAL_CREATION

Analysis of Calcium Variability in Turnip Leaves

This code is also available in: Español Français
Awaiting validation
The script internally initializes a dataset named 'Turnip' via a DATALINES block. This dataset contains calcium concentration measurements structured by 'Plant' and 'Leaf', with multiple 'Sample' per 'Leaf'. Subsequently, the PROC NESTED procedure is applied to this dataset. It is configured to model the nested classification factors 'plant' and 'leaf' and to analyze the 'calcium' response variable, allowing for the estimation of variance components associated with each nesting level.
Data Analysis

Type : INTERNAL_CREATION


The 'Turnip' dataset is entirely created within the SAS script using a DATALINES block to provide raw calcium concentration data. No external data sources or pre-existing SAS libraries (like SASHELP) are used for input data.

1 Code Block
DATA STEP Data
Explanation :
This DATA block creates the 'Turnip' dataset. It uses nested loops to generate observations representing 4 'Plant's, 3 'Leaf's per plant, and 2 'Sample's per leaf. The 'Calcium' variable is read sequentially from the numeric values provided in the DATALINES block, thus populating the dataset with the specified hierarchical structure.
Copied!
1DATA Turnip;
2 DO Plant=1 to 4;
3 DO Leaf=1 to 3;
4 DO Sample=1 to 2;
5 INPUT Calcium;
6 OUTPUT;
7 END;
8 END;
9 END;
10 DATALINES;
113.28 3.09 3.52 3.48 2.88 2.80 2.46 2.44
121.87 1.92 2.19 2.19 2.77 2.66 3.74 3.44
132.55 2.55 3.78 3.87 4.07 4.12 3.31 3.31
14;
2 Code Block
PROC NESTED
Explanation :
This PROC NESTED procedure is executed on the 'Turnip' dataset to perform a variance component analysis. The 'plant' and 'leaf' variables are declared as nested classification ('class') variables, meaning that leaves are considered nested within plants. The 'calcium' variable is defined as the response ('var') variable whose variability is analyzed. The procedure calculates variance component estimates for each nested factor, helping to understand the sources of calcium variation.
Copied!
1PROC NESTED DATA=Turnip;
2 class plant leaf;
3 var calcium;
4RUN;
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 : SAS SAMPLE LIBRARY