- 37
- 153 828
Michael T. Gastner's Quantitative Reasoning
Приєднався 15 гру 2012
Tutorials on statistics and programming
Introduction to Data Science: Stepwise Regression
Tutorial for Yale-NUS course 'Introduction to Data Science'.
Textbook: D. Diez et al. (2019). 'OpenIntro Statistics' (4th ed., OpenIntro). Available at www.openintro.org/book/os/
Analysing George W. Bush's approval ratings:
R code: www.michaelgastner.com/intro_to_data_science/bush_approval.R
Supplementary data: www.michaelgastner.com/intro_to_data_science/bush_approval.csv
Analysing Ebay auctions:
R code: www.michaelgastner.com/intro_to_data_science/mario.R
Supplementary data: www.michaelgastner.com/intro_to_data_science/mario.csv
Final quiz answer: 4
Textbook: D. Diez et al. (2019). 'OpenIntro Statistics' (4th ed., OpenIntro). Available at www.openintro.org/book/os/
Analysing George W. Bush's approval ratings:
R code: www.michaelgastner.com/intro_to_data_science/bush_approval.R
Supplementary data: www.michaelgastner.com/intro_to_data_science/bush_approval.csv
Analysing Ebay auctions:
R code: www.michaelgastner.com/intro_to_data_science/mario.R
Supplementary data: www.michaelgastner.com/intro_to_data_science/mario.csv
Final quiz answer: 4
Переглядів: 430
Відео
R Tutorial 36: Debugging for-loops
Переглядів 4,5 тис.3 роки тому
Yale-NUS Quantitative Reasoning 2020. For the code in this video, see transcript at: michaelgastner.com/R_for_QR/ Adjust your UA-cam settings to view video with HD quality and closed captions.
R Tutorial 35: for-loops
Переглядів 1,3 тис.3 роки тому
Yale-NUS Quantitative Reasoning 2020. Derivation of the probabilities of the number of suits in 5 random poker cards: math.stackexchange.com/questions/224974/probability-for-suits-in-5-card-poker-hand. Link to Nicholas Metropolis, "The Beginning of the Monte Carlo Method": library.lanl.gov/cgi-bin/getfile?15-12.pdf. Adjust your UA-cam settings to view video with HD quality and closed captions. ...
R Tutorial 34: Vectors with Repeating Elements
Переглядів 8943 роки тому
Yale-NUS Quantitative Reasoning 2020. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 33: Setting the Seed of the Random Number Generator
Переглядів 2,3 тис.3 роки тому
Yale-NUS Quantitative Reasoning 2020. Mersenne Twister paper: www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.pdf. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 32: Random Permutations and Random Samples
Переглядів 1,6 тис.3 роки тому
Yale-NUS Quantitative Reasoning 2020. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 31: Making Predictions on the Basis of a Linear Model
Переглядів 2 тис.3 роки тому
Yale-NUS Quantitative Reasoning 2020. Download NHANES data from michaelgastner.com/data_for_QR/body_measurements.csv. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 30: Extracting Information about a Linear Model
Переглядів 1,9 тис.3 роки тому
Yale-NUS Quantitative Reasoning 2020. Download NHANES data from michaelgastner.com/data_for_QR/body_measurements.csv. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 29: Fitting a Linear Model
Переглядів 3,8 тис.3 роки тому
Yale-NUS Quantitative Reasoning 2020. Download NHANES data from michaelgastner.com/data_for_QR/body_measurements.csv. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 28: Calculating Correlation Coefficients with R
Переглядів 40 тис.3 роки тому
Yale-NUS Quantitative Reasoning 2020. Download NHANES data from michaelgastner.com/data_for_QR/body_measurements.csv. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 27: Visual Comparisons of Data with a Normal Model
Переглядів 1,3 тис.4 роки тому
Yale-NUS Quantitative Reasoning 2020. Download body weight data from michaelgastner.com/data_for_QR/nhanes_dvvb_ch5.csv. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 26: Computations Related to Normal Models
Переглядів 1,5 тис.4 роки тому
Yale-NUS Quantitative Reasoning 2020. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 25: z-scores with R
Переглядів 13 тис.4 роки тому
Yale-NUS Quantitative Reasoning 2020. Download 2012 Olympic heptathlon data from michaelgastner.com/data_for_QR/hept2012.csv. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 24: Re-expression with R
Переглядів 1 тис.4 роки тому
Yale-NUS Quantitative Reasoning 2020. Download CEO compensation data from michaelgastner.com/data_for_QR/forbes500_ceo_comp.csv. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 23: Multi-variable Scatter Plots and Line Charts
Переглядів 11 тис.4 роки тому
Yale-NUS Quantitative Reasoning 2020. Download GDP data from michaelgastner.com/data_for_QR/gdp_usa_ussr.csv. Adjust your UA-cam settings to view video with HD quality and closed captions. Transcript available at: michaelgastner.com/R_for_QR/
R Tutorial 22: Scatter Plots and Line Charts
Переглядів 1,5 тис.4 роки тому
R Tutorial 22: Scatter Plots and Line Charts
R Tutorial 19: which() Indices are TRUE?
Переглядів 1,2 тис.4 роки тому
R Tutorial 19: which() Indices are TRUE?
R Tutorial 17: Exporting a Data Frame to CSV
Переглядів 13 тис.4 роки тому
R Tutorial 17: Exporting a Data Frame to CSV
R Tutorial 16: Exporting Graphics to a File
Переглядів 1,8 тис.4 роки тому
R Tutorial 16: Exporting Graphics to a File
R Tutorial 13: Summary Statistics in R
Переглядів 1,2 тис.4 роки тому
R Tutorial 13: Summary Statistics in R
R Tutorial 10: Counting TRUE values in logical vectors
Переглядів 1,5 тис.4 роки тому
R Tutorial 10: Counting TRUE values in logical vectors
R Tutorial 06: Extracting Values from Data Frames
Переглядів 16 тис.4 роки тому
R Tutorial 06: Extracting Values from Data Frames
pls can i get your titanic project
Thank you for your message. I believe I used this file for the Titanic data: michaelgastner.com/data_for_QR/titanic.csv. Please let me know if it works for you.
nice video
Thank you for the positive feedback.
This is very helpful. Thank you, Michael!
You are welcome. I am glad you found it helpful.
The best tutorial I have found. I am taking the complete course. Thanks again.
Thank you, @Minely182! I am glad to hear that you find the tutorial helpful.
I would appreciate more tutorial lessons, please.
Thank you, @Minely182, for your interest in more tutorial lessons. I truly appreciate your request. While I am not currently working on new tutorials for this series of tutorials, I may create a new series in the future.
"Unfortunately, the answer is no...a function called 'scale()', which returns the zed scores, but not as a vector" ok, but you can just convert the scores into a vector with a single line of code. e.g.: ua-cam.com/video/YLWbtw766mA/v-deo.html
I agree, @AnthonyLopez-di5vv! However, in this series of tutorials, I am deliberately keeping things simple for beginners who have not encountered matrices and may, therefore, get confused about the output.
Why does my exported csv have all columns in-line like this in Excel: 8,"UA-cam",NA,NA,NA instead of neat tables like yours?
Thank you for reaching out. It is difficult to diagnose the issue without more information about your data and the steps you followed. However, here are a few general suggestions that might help: (1) Double-check the delimiter. Is it a comma? (2) Check for special characters that might trip up R or Excel. (3) Does the file start with a row that is not meant to be interpreted as column names?
@@michaelgastner hey, thanks for the reply! It's not a problem with the file, it's a problem with excel. Sure, I can go to Data > import and then go through all the steps of importing csv file with all the delimiters and such and it will look as it should. But in your video you simply clicked on it and it already formatted it properly. How did you set up excel to do that?
Thank you Michael
You’re welcome, Arseniy
Super cool way of teaching. Nice and smooth
I appreciate your positive feedback. Thanks for watching!
Thanks to these videos I am learning more than in one week course.
Great to hear that you find the videos useful.
Thank you so much. You are so concisce. I am learning every day with your tutorials.
Thank you for the positive feedback.
Thank you!!!
The code doesnt work :(
Thank you for your comment. I'm sorry to hear that the code didn't work for you. Could you please provide more details on what you tried and what exactly didn't work? Were there any error messages generated by R? This will help me better understand the issue and find a solution for you.
How to export data that wasn't originally imported from a CSV, but instead came from an API?
A Google search brings up some tutorials (e.g. www.dataquest.io/blog/r-api-tutorial/, www.r-bloggers.com/2015/11/accessing-apis-from-r-and-a-little-r-programming/ and www.earthdatascience.org/courses/earth-analytics/get-data-using-apis/API-data-access-r/).
Really helpful series of tutorial for our Data Science class!!! Thank you very much!!!
Thank you for kind words. I am glad to hear that you find the tutorials useful.
Your tutorials are gorgeous, everything is straightforward and clear, thank you!!!
Thank you. I am glad to hear that you enjoy the tutorials.
clear and concise explanation, perfect for beginners in R, thank you a lot.
Thank you for the positive feedback.
cor(bm) is not working. Should I install any library?
Have you moved body_measurements.csv to your project directory? Have you assigned the data frame to a variable named bm? If the error persists, what is the error message?
thanks
Thank for video very helpful. I need textbook
Our course used this book: www.amazon.com/Stats-Models-Richard-D-Veaux/dp/0321986490.
thank you so much for creating this tutorial
Thank you 3 times!
Glad to hear the video was useful.
how can we combine summary of statistics and correlation plot in one diagram. thanx
Thank you, the explanation was excellent, now I got the big picture of the function.
Thank you for your positive feedback.
Excelente!!
thank youu for the tutorials!!
Thank you for the positive feedback.
Thank you. Such a clear, well-structured explanation with a range of useful examples. Appreciated on many levels.
Thank you for your kind words. I am glad you find the video useful.
A very wonderful and presentation for both teachers and students👍
Thank you very much for your kind words.
Thank you so much, I was looking for exactly this. Very well explained, I'd love to know what's the other method you mention to make it in a more elegant way.
Thank you for producing and publicly posting these tutorial videos! I teach a graduate applied stats lab in psychology, and we decided to start slowly dipping our toes into R this year (starting off with correlations only). Your videos have been the most straight-forward and easy-to-understand introduction I've found. I feel like I'm ready to start experimenting on my own, not completely lost and overwhelmed by new code.
Thank you for your kind comments. I am glad you find the videos useful.
Hi Sir, can we overlay the boxplot with point plot (normal plot)?
If you want to show the individual points that are summarised by the box plot, you can use stripchart(), see stackoverflow.com/questions/23675735/how-to-add-boxplots-to-scatterplot-with-jitter
Hi. Please I exported data using the write.csv function, but the table gets truncated. The original table has 4,073,561 rows, but the csv file has about 700,000 rows. Please how do I rectify this?
I cannot reproduce your problem. I have just tested this minimal working example: ```{r} dfr <- data.frame(random_digits = sample(0:9, 1e7, replace=TRUE)) write.csv(dfr, "very_long.csv") ``` It creates a CSV file with 10 million rows (plus one row for the header). Perhaps your spreadsheet software (Excel?) cannot load all rows, but there is no limitation in R that there cannot be more than 700,000 rows in an exported CSV file.
Thank You so much for such clear explanation..
nice video. But how to export the median value for the three boxplot sir?
You can use aggregate() as explained in lesson 20 (ua-cam.com/video/5j8XR0fvRD0/v-deo.html): aggregate(Sepal.Width ~ Species, data = iris, FUN = median)
@@YaleNUSQuantitativeReasoning it helps me a lot. Thank you sir
Thanks 👏🏼
Thank you so very much for these tutorials! They helped me a lot !!
I can rest in peace now.
Glad to hear my video has promoted world peace
Thank you for this very clear explanation. If I want to add 2 labels to Y axis, for eg, "GDP of US, GDP of USSR" how do I do it.
Usually, the y-axis label would summarise both data sets (e.g. "GDP") and a legend (e.g. different colours for different countries) would be used, as shown at 3:45.
@@michaelgastner thank you for the reply. I wanted to clarify, if after using points function, is there any way to update the Y axis labels. I am fairly new to R, and was plotting height and weight on Y axis, with age on X axis. So after using the points function for weight, how do i update the y axis labels to show "weight,height". I am doing the legend as well, but not sure on how to show it in the y axis
@@soulwriterqa2363 You can change the y-axis label with the argument ylab in plot(). For more complex layouts, there is also a function axis().
how about the pnorm function?
Can you please give more context?
pnorm calcaulates the probability(area) for a selected value
Thank you for the video!
Thank you for teaching us how to debug Prof, it was very educational. :)
Thank you for the video Prof! I know you said humans don't like doing repetitive tasks, so I hope making these videos aren't a huge burden for you. (Writing these comments doesn't get tiring, I hope you appreciate them!) :)
Thank you for the positive feedback!
Hello Professor Gastner, It has been a delightful 12 weeks of QR here in Yale-NUS. Thank you so much for responding to me here, on this last set of videos. I was deeply saddened when I was informed that there would be no more R tutorials, nothing more that we could learn from you for this course. These video tutorials have been unmeasurably useful to not just me, but many of my fellow colleagues here in this course for learning how to code in Rstudio. If I had to learn from anyone for any other statistics and coding courses here in Yale-NUS, it would be a pleasure to once again hear your voice in another set of videos. Once again, thank you so much for all the educational videos Prof, and I hope I'll see you around someday. To everyone else who I know is probably reading this (lol), make sure to hit that like button and subscribe to Yale-NUS Quantitative Reasoning channel, you won't find a better set of resources elsewhere. Well, this has been a fun ride. Peace out, and have a nice day! :)
Thanks for the vid Prof Gastner, it was very educational :)
"R complains that it 'cannot take a sample larger than the population when replace = FALSE'🤣🤣🤣 Prof Gastner is so cute!
Wow! Thank you for seeding this knowledge in my mind Prof. Thank you! :)
What a great educational lesson, thank you so much Professor Gastner! Can't wait to learn more in QR with you. :)
Thank you for the helpful video Professor Gastner! :)
Very nice video, thank you for posting. :)
Thank you for the video lesson Prof Gastner! I had fun learning today once again. :)
Hello Professor Gastner, nice to hear you again after the break, I missed these QR videos. Thanks for continuing to teach us how to code with RStudio. :)