The script implements a DATA step to build the 'practice1' dataset. This dataset contains three variables: 'soda' (character, beverage preference), 'animal' (character, animal preference) and 'weight' (numeric, representing counts). The data is directly integrated via the `datalines` block. Script comments indicate an intention to later use PROC FREQ with the CHISQ option to test the independence between beverage preference and pet preference, using the 'weight' variable as frequency weights. However, PROC FREQ itself is not present in the provided code snippet.
Data Analysis
Type : CREATION_INTERNE
The 'practice1' dataset is created directly within the script using a DATA step and `datalines`. No external or SASHELP data sources are used for this dataset's creation.
1 Code Block
DATA STEP Data
Explanation : This code block uses a DATA step to create a dataset named 'practice1'. It defines three variables: 'soda' and 'animal' as character (indicated by '$'), and 'weight' as numeric. The data is then provided inline via the `datalines` block, representing beverage preferences (Coke or Pepsi) and animal preferences (Dog or Cat), along with corresponding counts. This dataset forms the basis for future statistical analyses.
Copied!
data practice1;
input soda $ animal $ weight;
datalines;
Coke Dog 78
Coke Cat 22
Pepsi Dog 36
Pepsi Cat 64
;
run;
1
DATA practice1;
2
INPUT soda $ animal $ weight;
3
DATALINES;
4
Coke Dog 78
5
Coke Cat 22
6
Pepsi Dog 36
7
Pepsi Cat 64
8
;
9
RUN;
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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.