P 1
P 1
data(mtcars)
print(rownames(mtcars))
print(summary(mtcars))
# 2. Frequency Tables
# 4. Variance-Covariance Matrix
cat("\nVariance-Covariance Matrix:\n")
# Interpretation
cat("\nInterpretation:\n")
cat("- The 'mtcars' dataset has 32 rows (observations) and 11 columns (variables).\n")
cat("- The variables include 'mpg' (miles per gallon), 'cyl' (number of cylinders), 'disp'
(displacement), 'hp' (horsepower), and others.\n")
cat("- Frequency tables show the distribution of values for each variable within specified
intervals.\n")
cat("- Mean and Standard Deviation provide measures of central tendency and variability.\
n")
cat("- 'mpg' and 'wt' might be good candidates for guessing car species due to potential
correlations with car size and engine type.\n")
cat("- The variance-covariance matrix shows the variance of each variable and the
covariance between pairs.\n")
cat("- Negative covariance suggests that as one variable increases, the other tends to
decrease.\n")
> data(mtcars)
>
Names of the variables: mpg cyl disp hp drat wt qsec vs am gear carb
> print(rownames(mtcars))
Number of rows: 32
Number of columns: 11