Descriptive statistics functions (summary, str)
Descriptive Statistics Functions (summary, str) Descriptive statistics functions provide valuable insights into the central tendency and dispersion of data,...
Descriptive Statistics Functions (summary, str) Descriptive statistics functions provide valuable insights into the central tendency and dispersion of data,...
Descriptive statistics functions provide valuable insights into the central tendency and dispersion of data, enabling us to summarize and communicate the key characteristics of a dataset.
Summary:
summary() function provides a comprehensive overview of the numeric variables in a dataset, including minimum and maximum values, mean, standard deviation, and more.
It also displays the distribution of numeric variables through histograms and boxplots, helping to visualize the data's central tendency and variability.
By default, summary() also generates a p-value for normality testing, indicating whether the data follows a normal distribution.
Str:
str() function displays the structure of a dataframe, providing detailed information about its variables and data types.
It includes information like variable names, data types, missing values, and sample size.
Additionally, str() allows us to access specific variables or subsets of data using indexing.
Examples:
1. Calculate summary statistics for numeric variables:
r
summary(data$numeric_variable)
2. Generate boxplot of a numeric variable:
r
boxplot(data$numeric_variable)
3. Get information about the dataframe:
r
str(data)
4. Access specific variables:
r
data$variable_name
By understanding these functions, we can effectively analyze and communicate the key characteristics of our data, enabling us to make informed decisions and gain insights from our data analysis