# Introduction to statistics with R

Data analysis is one of the main focuses of this book. While the computing tools we have introduced are relatively recent developments, data analysis has been around for over a century. Throughout the years, data analysts working on specific projects have come up with ideas and concepts that generalize across many applications. They have also identified common ways to get fooled by apparent patterns in the data and important mathematical realities that are not immediately obvious. The accumulation of these ideas and insights has given rise to the discipline of statistics, which provides a mathematical framework that greatly facilitates the description and formal evaluation of these ideas.

To avoid repeating common mistakes and wasting time reinventing the wheel, it is important for a data analyst to have an in-depth understanding of statistics. However, due to the maturity of the discipline, there are dozens of excellent books already published on this topic and we therefore do not focus on describing the mathematical framework here. Instead, we introduce concepts briefly and then provide detailed case studies demonstrating how statistics is used in data analysis along with R code implementing these ideas. We also use R code to help elucidate some of the main statistical concepts that are usually described using mathematics. We highly recommend complementing this part of the book with a basic statistics textbook. Two examples are Statistics by Freedman, Pisani, and Purves and Statistical Inference by Casella and Berger. The specific concepts covered in this part are Summary Statistics, Probability, Statistical Inference, Statistical Models, Regression, and Linear Models, which are major topics covered in a statistics course. The case studies we present relate to the financial crisis, forecasting election results, understanding heredity, and building a baseball team.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9472922,"math_prob":0.8017513,"size":1932,"snap":"2023-40-2023-50","text_gpt3_token_len":336,"char_repetition_ratio":0.12655602,"word_repetition_ratio":0.0,"special_character_ratio":0.16718426,"punctuation_ratio":0.095679015,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97124463,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-28T23:33:54Z\",\"WARC-Record-ID\":\"<urn:uuid:b266a405-c8b6-458e-a39f-88b45ba10d4a>\",\"Content-Length\":\"137201\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:428fa9c4-b37c-4ec2-8e83-d1a3e6a6c834>\",\"WARC-Concurrent-To\":\"<urn:uuid:5d6c080b-0e0e-4019-bf32-0fd11ecfaf6c>\",\"WARC-IP-Address\":\"185.199.111.153\",\"WARC-Target-URI\":\"https://rafalab.dfci.harvard.edu/dsbook/introduction-to-statistics-with-r.html\",\"WARC-Payload-Digest\":\"sha1:T6VVZGLTVR4FEKWSOVBZPZQQ3HCQK5CE\",\"WARC-Block-Digest\":\"sha1:2GGV6EHOEQKASG7TIJG3YOSD6VMYNXRR\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510462.75_warc_CC-MAIN-20230928230810-20230929020810-00338.warc.gz\"}"}