Published on :
Statistical CREATION_INTERNE

Automobile Model Reliability

This code is also available in: Deutsch Español Français
Awaiting validation
The script begins by creating a dataset named 'auto' containing variables for the manufacturer ('Make'), model ('Model'), and a reliability score ('Score'), with data provided directly in the script via datalines. Then, it sorts this dataset by 'Make' and 'Model'. Finally, the NESTED procedure is executed to perform a random-effects analysis of variance on the 'Score', using 'Make' and 'Model' as nested factors, allowing for the estimation of variance components associated with each classification level.
Data Analysis

Type : CREATION_INTERNE


The 'auto' dataset is created directly within the script from embedded data (datalines), without external dependencies or the use of SASHELP data.

1 Code Block
DATA STEP Data
Explanation :
This DATA STEP block creates the 'auto' dataset. It defines three variables: 'Make' (character), 'Model' (numeric), and 'Score' (numeric). Data for these variables is provided directly in the script via the DATALINES statement, representing reliability scores for different car models.
Copied!
1title1 'Reliability of Automobile Models';
2DATA auto;
3 INPUT Make $ Model Score;
4 DATALINES;
5a 1 62 a 2 77 a 3 59
6a 1 67 a 2 73 a 3 64
7a 1 60 a 2 79 a 3 60
8b 1 72 b 2 58 b 3 80
9b 1 75 b 2 63 b 3 84
10b 1 69 b 2 57 b 3 89
11c 1 94 c 2 76 c 3 81
12c 1 90 c 2 75 c 3 85
13c 1 88 c 2 78 c 3 85
14d 1 69 d 2 73 d 3 90
15d 1 72 d 2 88 d 3 87
16d 1 76 d 2 87 d 3 92
17;
2 Code Block
PROC SORT
Explanation :
This block uses PROC SORT to sort the 'auto' dataset by the 'Make' and 'Model' variables. Sorting is a preparatory step for some analyses, although it is not always strictly mandatory for PROC NESTED.
Copied!
1PROC SORT DATA=auto;
2 BY Make Model;
3RUN;
3 Code Block
PROC NESTED
Explanation :
This block executes PROC NESTED on the 'auto' dataset. It specifies 'Make' and 'Model' as classification variables, establishing a nested structure, and 'Score' as the analysis variable. This procedure is used to estimate variance components in a random-effects analysis of variance model.
Copied!
1title1 'Reliability of Automobile Models';
2PROC NESTED DATA=auto;
3 class Make Model;
4 var Score;
5RUN;
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