Docsity

Exploratory data analysis, Cheat Sheet of Engineering

Partial preview of the text

Download Exploratory data analysis and more Cheat Sheet Engineering in PDF only on Docsity!

Exploratory Data Analysis

Unit 3

Introduction to EDA Exploratory Data Analysis (EDA) is a crucial step in the data analysis process, focusing on analyzing and visualizing datasets to uncover patterns, relationships, and insights without preconceived hypotheses EDA involves using graphical representations and summary statistics to explore data sets. The primary goal is to understand the underlying structure of the data, identify anomalies, and generate hypotheses for further analysis.

Steps in EDA Understand the Data: Familiarize yourself with the dataset, including its structure and the types of variables involved. Data Collection: Gather data from various sources such as databases, APIs, or web scraping. Data Cleaning: Address issues like missing values, duplicates, and incorrect data types to ensure data quality. Data Transformation: Normalize or standardize data as needed and create new features through feature engineering. Data Integration: Combine data from different sources to form a comprehensive dataset for analysis.

Descriptive Statistics Descriptive statistics is a fundamental aspect of statistical analysis that focuses on summarizing and presenting the characteristics of a data set. It serves as a crucial tool in both quantitative and qualitative research by providing clear insights into the data without making inferences or predictions about a larger population.

Mean The mean, or average, is calculated by summing all values in a dataset and dividing by the number of values. In finance, the mean is used to analyze investment returns. For example, if an investor tracks the annual returns of a stock over five years as 10%, 12%, -5%, 8%, and 15%, the mean return can be calculated as: Mean Return =(10+12 −5+8+15)/5=8% This average helps investors gauge the stock's performance over time and make informed decisions about future investment

Median

The median is the middle value in a dataset when arranged in

ascending order. If there is an even number of observations, the

median is the average of the two middle numbers.

In real estate, agents often use the median home price to provide a

better understanding of market conditions.

For instance, if home prices in a neighborhood are $200,000,

$250,000, $300,000, $350,000, and $1,000,000, the median price is

This measure is less affected by extreme values (like the $1 million

home) than the mean would be

Standard Deviation Standard deviation measures the amount of variation or dispersion in a set of values. A low standard deviation indicates that values tend to be close to the mean, while a high standard deviation indicates that values are spread out over a wider range.

Standard Deviation In finance, standard deviation is used to assess investment risk. For example, if two stocks have the same mean return but one has a higher standard deviation, it indicates that its returns are more volatile and thus riskier. Investors may prefer stocks with lower standard deviations for stability

Variance In quality control processes in manufacturing, variance can help determine product consistency. If a factory produces widgets with weights averaging 10 grams but with high variance, it indicates significant weight discrepancies among products. Reducing variance can lead to improved quality assurance

Hypothesis Testing

Significance Level (α) The significance level is the threshold for deciding whether to reject the null hypothesis. Common values are 0.05 (5%) and 0.. It represents the probability of making a Type I error, which occurs when the null hypothesis is incorrectly rejected.

Null Hypothesis (H0) The null hypothesis is a statement that there is no effect, no difference, or no relationship between variables in the population. It serves as the default assumption that any observed differences in sample data are due to random chance rather than a true effect. Examples of Null Hypothesis: ● In a clinical trial, the null hypothesis might state that a new drug has no effect on patients compared to a placebo. ● In a study comparing two teaching methods, the null hypothesis could assert that there is no difference in student performance between the two methods. The null hypothesis is typically tested using statistical methods, and the

Hypothesis testing process

1. State the Hypotheses: Clearly define the null and alternative
hypotheses.
2. Choose a Significance Level (
  1. 𝛼 4. α ): Common choices are 0.05 or 0.01, which represent the
probability of rejecting the null hypothesis when it is actually true
(Type I error).
5. Collect Data: Gather sample data relevant to the hypotheses.
6. Perform Statistical Test: Use an appropriate statistical test (e.g., t-
test, chi-square test) to analyze the data.

T-test

A t-test is a statistical hypothesis test used to determine whether
there is a significant difference between the means of one or two
groups. It is particularly useful when the sample sizes are small and
the population standard deviation is unknown. The t-test can be
categorized into three types:
One-Sample T-Test: Compares the mean of a single group against a
known value (e.g., a population mean).
Independent Two-Sample T-Test: Compares the means of two
independent groups to see if they are significantly different from
each other.