Adam Petrie
Adam Petrie
  • 200
  • 137 984
Data Wrangling 3 - dplyr for taking subsets (filter), sorting (arrange), and summarizing (group_by)
00:00 - Skippable Introduction
00:43 - Overview of what we do with a flat file
01:40 - Commands in this video: select, arrange, filter, group_by, summarize
02:32 - Reading in the 3 Telecom tables and joining (link at bottom)
03:38 - Merging to get a flat file
05:45 - select command for keeping columns
06:45 - arrange for sorting rows
09:14 - Using t.test to compare average monthly charges
11:57 - Overview of filter command
13:23 - Example 1 - Dependents=="Yes"
16:09 - Example 2 - tenure == 1
17:28 - Example 3 - not equal to !=
18:45 - Example 4 - %in% (one of the following)
20:54 - Example 5 - inequalities like less than, at least, greater than or equal to, etc
21:41 - Example 6 - getting rows where a value is inside a range
22:52 - Example 7 - multiple conditions in general (AND &)
24:24 - Example 8 - one OR another condition with |
27:13 - select function and its uses
28:01 - Optional challenge for you - complex subset and t.test
28:47 - Solution to challenge
35:19 - group_by and summarize
35:56 - Purpose of group_by
37:25 - Example: Average tenure for customers that are and are not senior citizens
38:03 - Example: Average tenure for each payment method
38:51 - Optional - ANOVA and connecting letters report for detecting differences
40:24 - Intro to comparing churn rates
41:28 - The mean(logical) condition trick to get churn rates (0-1) when entries are Yes/No
43:46 - Getting churn rates for each payment method
46:10 - Example - median fraction of charges that happened last month for each Contract type
48:21 - Summarizing combinations of groups
52:04 - Skippable Outro Video
52:59 - Outtakes
Files on Dropbox: www.dropbox.com/scl/fo/qgvma7gr7p6e5kwxdqvbz/AMWlM6HQDXJ-xnNRXwittJg?rlkey=eudt1siz96bsyrxto8k9zz1u3&st=yndwsyyv&dl=0
Reading in data from google sheets - get the dplyrscript.R file and you'll see the code in there. Unfortunately if I try pasting the code here it turns it into a URL that doesn't work!
มุมมอง: 285

วีดีโอ

Data Wrangling 2 - using dplyr to bind, join, and merge data (bind_rows, inner_join, etc., mutate)
มุมมอง 3975 หลายเดือนก่อน
00:00 - Skippable Introduction 02:17 - Overview of combining data sources 05:29 - Overview of commands covered in video 06:20 - bind_rows to append tables 12:10 - Analytics on the Spotify data 14:30 - Towards joins - why we merge sources 17:33 - left_join 19:42 - by=join_by shortcuts 20:37 - Joining by composite keys (combination of columns) 23:16 - right_join 24:38 - inner_join 25:07 - full_jo...
Data Wrangling 1 - learning to use pipes in R
มุมมอง 4775 หลายเดือนก่อน
00:00 - Skippable Introduction 00:30 - Why learn about piping? 02:00 - History of the Pipe 03:30 - Getting Petrie ready with Pipes 06:53 - What is pipe doing 07:52 - Using pipes to make donuts 08:29 - Baking a cake with pipes 09:42 - Don't feel compelled to pipe EVERYTHING 11:37 - Example pipe - sequence of mathematical operations on a vector 16:36 - Example - piping to get smallest 4 values in...
Tribute to Cannon and Jackson
มุมมอง 2696 หลายเดือนก่อน
Two of the best Frenchies on the planet, unfortunately taken from us much too soon! 00:05 - Introducing Cannon! His first year. 07:45 - Who is it? It's Jackson! They were forever playmates. 11:14 - Would you like to go to doggy day care? 13:58 - Day to day living with Cannon and Jackson 18:07 - Mamaw Pokey's! 19:24 - Snow! 20:10 - Do you want to want to go for a ride? 20:34 - Cannon's crazy ant...
Gold Creek Pond and Mirror Lake in the Cascade Mountain Range in Washington State, July 6-8, 2024
มุมมอง 506 หลายเดือนก่อน
Gold Creek Pond and Mirror Lake in the Cascade Mountain Range in Washington State, July 6-8, 2024
Maui, Hawaii, January 2024
มุมมอง 2547 หลายเดือนก่อน
Maui, Hawaii, January 2024
Burgess Falls Tennessee, June 13, 2024
มุมมอง 317 หลายเดือนก่อน
Somehow I've lived 1.5 hours away from Burgess Falls for almost 17 years and had never heard of it. Now it's one of my favorite places!
Little River Canyon and Vulcan Park Alabama October 2024
มุมมอง 517 หลายเดือนก่อน
Little River Canyon and Vulcan Park Alabama October 2024
Ch 6B - Multiple Logistic Regression
มุมมอง 768ปีที่แล้ว
00:00 - Skippable Introduction 00:12 - Overview of Multiple Logistic Regression 01:12 - Hotel dataset 02:58 - Simple logistic regression review 04:14 - Categorical variable as sole predictor 06:16 - drop1 with test=Chisq 06:58 - Multiple Logistic Regression model 07:26 - Statistical significance meaning 10:42 - Interpretation of coefficients (signs) 12:33 - Linear regression: Categorical predic...
Ch 5B - Incorporating interactions with a categorical variable in a multiple regression model
มุมมอง 783ปีที่แล้ว
00:00 - Skippable Introduction 00:15 - Overview: categorical predictors 00:54 - Review : encoding categorical variables 02:00 - Indicator variables allow use to compare averages between levels after accounting for lurking variables (Harris Bank discrimination review) 02:47 - Adding categorical predictor (no interaction) lets each level have its own intercept (common slope) 03:10 - Separation be...
Ch4D - Multiple Linear Regression (Polynomial Models and Interaction Terms)
มุมมอง 1.2Kปีที่แล้ว
00:00 - Skippable Introduction 00:40 - Linear regression is good when relationships are linear 01:23 - Examples of nonlinearity: Sale Price vs Year Made for bulldozers and Fuel Efficiency vs Horsepower for cars 02:33 - Review: find_transformations for fixing nonlinearity 04:12 - Intro to polynomials (order of model) 04:55 - Choose order for bulldozer data 08:33 - Fitting a polynomial model with...
Ch4A - Multiple Linear Regression (Predictive and Descriptive Analytics)
มุมมอง 1.2Kปีที่แล้ว
00:00 - Skippable Introduction 00:18 - Simple linear regression is a good but incomplete tool 01:24 - Overview of multiple regression 03:16 - Predictive analytics with multiple regression 10:23 - Overview of descriptive analytics with multiple regression 11:03 - Review of simple linear regression 11:46 - Coefficients in simple linear regression can be misleading if there is more than 1 reason w...
Ch2B - Pearson vs Spearman Rank Correlations and the Permutation Test for Statistical Significance
มุมมอง 1.1Kปีที่แล้ว
00:00 - Skippable Intro 00:08 - Overview of analyzing associations between 2 numeric variables 01:59 - Always start with a scatterplot 02:21 - When to use Pearson's correlation 02:54 - When to use Spearman's rank correlation 03:36 - Examples where Pearson's correlation should be used 06:11 - Examples where Pearson's correlation doesn't work (use Spearman instead) 09:20 - Steps for performing th...
Working with Data in R: Data Frames
มุมมอง 2.1Kปีที่แล้ว
00:00 - Skippable Introduction 00:26 - Spreadsheet in Excel (tips.csv) 01:09 - Using data.frame() to make a "spreadsheet" 02:17 - Looking at and previewing contents of data frames 03:11 - Built-in dataframes in base R; data() command 03:45 - Loading data from other libraries; library() and data() command 04:30 - Using read.csv() to read in data files 05:14 - stringsAsFactors = TRUE vs FALSE whe...
Working with Data in R: Vectors
มุมมอง 2.3Kปีที่แล้ว
00:00 - Skippable Introduction 01:00 - Creating vectors with c() function 02:30 - Creating a factor / categorical variables 02:53 - Converting between vector types 05:52 - Put everything in quotes if text vector 06:53 - seq() for making regularly spaced sequences 08:41 - Integer sequence shortcut with : 09:18 - rep() for creating patterns 11:18 - Referring to positions in vector with [ ] 14:29 ...
Basic Calculations and Functions in R
มุมมอง 2Kปีที่แล้ว
Basic Calculations and Functions in R
Sequoyah Hills August 16 2023
มุมมอง 23ปีที่แล้ว
Sequoyah Hills August 16 2023
Working with RStudio
มุมมอง 2.5Kปีที่แล้ว
Working with RStudio
Iceland DJI Mini 2 Footage June 2023
มุมมอง 242ปีที่แล้ว
Iceland DJI Mini 2 Footage June 2023
Mystical Coasts of California and Oregon
มุมมอง 912 ปีที่แล้ว
Mystical Coasts of California and Oregon
Madonna Inn and Pacific Coast Highway July 16 2022
มุมมอง 192 ปีที่แล้ว
Madonna Inn and Pacific Coast Highway July 16 2022
Lake Tahoe July 8-9, 2022
มุมมอง 492 ปีที่แล้ว
Lake Tahoe July 8-9, 2022
Great Smoky Mountains June 2022
มุมมอง 582 ปีที่แล้ว
Great Smoky Mountains June 2022
Lake Michigan and Lake Superior, June 2022
มุมมอง 422 ปีที่แล้ว
Lake Michigan and Lake Superior, June 2022
Palm Springs and Lake Hemet December 2022
มุมมอง 722 ปีที่แล้ว
Palm Springs and Lake Hemet December 2022
New Mexico March 2022
มุมมอง 352 ปีที่แล้ว
New Mexico March 2022
Flight around the Sunsphere
มุมมอง 643 ปีที่แล้ว
Flight around the Sunsphere
Philipsburg, St. Maartin Jan 6, 2022
มุมมอง 543 ปีที่แล้ว
Philipsburg, St. Maartin Jan 6, 2022
Green Island, Antigua - Jan 10, 2022
มุมมอง 9063 ปีที่แล้ว
Green Island, Antigua - Jan 10, 2022
Thanksgiving 2021
มุมมอง 423 ปีที่แล้ว
Thanksgiving 2021

ความคิดเห็น

  • @soheilmohammadi7076
    @soheilmohammadi7076 4 หลายเดือนก่อน

    👌👌👌👌

  • @soheilmohammadi7076
    @soheilmohammadi7076 4 หลายเดือนก่อน

    thank you for this great series of lectures , you are awesome 👌👌👌

  • @rexevan6714
    @rexevan6714 5 หลายเดือนก่อน

    Nice video. These days people will use |> instead of %>% but they pretty much doing the same thing.

  • @wapsyed
    @wapsyed 5 หลายเดือนก่อน

    man, this is the most comprehensive and easy tutorial I came across. I was almost giving up learning shiny haha thanks and congratz!

  • @fultonfitzgerald7155
    @fultonfitzgerald7155 6 หลายเดือนก่อน

    Do you have any videos showing how to do simple linear regression in R?

  • @Stat201atUTK
    @Stat201atUTK 7 หลายเดือนก่อน

    Beautiful! October 2024 looks amazing!

    • @AdamPetrie
      @AdamPetrie 7 หลายเดือนก่อน

      A glimpse into the future 😆 Yes it's fantastic!

  • @enesozel
    @enesozel 8 หลายเดือนก่อน

    Amazing shots! I am in love with Oregon's coasts as well as Mt. Hood region. Thor's Well was a very interesting sight as well (ba-dum-tss).

  • @karlahernandez9534
    @karlahernandez9534 8 หลายเดือนก่อน

    Best shiny applications tutorial !! Thank you so muchhh

  • @Satk-n1p
    @Satk-n1p 11 หลายเดือนก่อน

    Excellent quality 👌

  • @vickmaturu8367
    @vickmaturu8367 ปีที่แล้ว

    Superhelpful man!

  • @ceosuji
    @ceosuji ปีที่แล้ว

    Man, love how you teach!

  • @atomofconsumption
    @atomofconsumption ปีที่แล้ว

    This is a great video that I keep returning to. Your students are lucky to have a course on this.

  • @Stat201atUTK
    @Stat201atUTK ปีที่แล้ว

    Awesome video!

  • @hansmeiser6078
    @hansmeiser6078 ปีที่แล้ว

    How to get the initial probabilities?

    • @AdamPetrie
      @AdamPetrie ปีที่แล้ว

      The probabilities in the transition matrix are usually found via data or by educated guesses!

  • @ryanlawson96
    @ryanlawson96 ปีที่แล้ว

    This looks awesome!

  • @Stat201atUTK
    @Stat201atUTK ปีที่แล้ว

    Awesome video! It's to the point and easy to follow with timestamps!

  • @osoriomatucurane9511
    @osoriomatucurane9511 ปีที่แล้ว

    Awesome tutorial, thank u for sharing

  • @asgerdalsgaard214
    @asgerdalsgaard214 ปีที่แล้ว

    What a great lesson, thank you so much!

  • @aliciacordova3088
    @aliciacordova3088 2 ปีที่แล้ว

    💕🤗 Love this video!

  • @applesushi
    @applesushi 2 ปีที่แล้ว

    Gorgeous!

  • @geraldine9225
    @geraldine9225 2 ปีที่แล้ว

    Thank you very much for sharing this useful information!

  • @axlmcintosh6148
    @axlmcintosh6148 2 ปีที่แล้ว

    Planning a trip up there in two weeks so I was curious what to expect. Wasn't sure if their would be any color or of I would be too late.

    • @AdamPetrie
      @AdamPetrie 2 ปีที่แล้ว

      The best color is gone...but you'll see some pockets of some that do remain!

  • @christinap802
    @christinap802 2 ปีที่แล้ว

    Wow, holy smokes. This is an exceptional video. I wish I attended this class because I would have learned so much. I stumbled onto this video after looking for some more clarity on interpreting the md.pattern output. I had no idea about this package and the tools to assess the associations around missingness (without a manual way). Thanks for sharing this video with the general public! This is a great help for someone that has learned MI outside the classroom. I appreciate your tone, pacing, and clarity :)

  • @yulinliu850
    @yulinliu850 2 ปีที่แล้ว

    Thanks for sharing.

  • @Fietskopen
    @Fietskopen 2 ปีที่แล้ว

    That was the most clearly explained analysis ive ever seen, thanks!

  • @malirk
    @malirk 2 ปีที่แล้ว

    Stunning footage!

  • @parthpatadiya9197
    @parthpatadiya9197 2 ปีที่แล้ว

    Thank you so much for the tutorial, Adam. Excellent Explanation!.. can you please help understand the topic crosstalk for graphs and filters in shiny? Thanks in advance.

  • @sanjayg2686
    @sanjayg2686 2 ปีที่แล้ว

    wow so nicly and fun way you explained throughly i loved it, Thank you sir

  • @aftak
    @aftak 2 ปีที่แล้ว

    Many thanks! Very well presented

  • @yannchoho9097
    @yannchoho9097 2 ปีที่แล้ว

    I love you guy , thank you for your help and be sure it help me a lot and continue to do this

  • @shreyaroraa2234
    @shreyaroraa2234 2 ปีที่แล้ว

    Is there an index structuRe for all your videos?

    • @AdamPetrie
      @AdamPetrie 2 ปีที่แล้ว

      There's a brief description of what's being discussed in the list of timestamps (clicking Show More in the video description will show the full list). This also brings up a useful Chapters view.

    • @shreyaroraa2234
      @shreyaroraa2234 2 ปีที่แล้ว

      @@AdamPetrie thanks Adam. Talking about all videos. Starting from probability videos to eventually learn modelling

  • @sanjayarora7825
    @sanjayarora7825 2 ปีที่แล้ว

    Very well explained. Thank You! Is there a index or playlist I can follow to know topics of interest?

    • @AdamPetrie
      @AdamPetrie 2 ปีที่แล้ว

      There's a brief description of what's being discussed in the list of timestamps (clicking Show More in the video description will show the full list). This also brings up a useful Chapters view.

  • @sharrathkanth9025
    @sharrathkanth9025 2 ปีที่แล้ว

    can you share the excel file sir for educational purpose

  • @pshyajindal7023
    @pshyajindal7023 2 ปีที่แล้ว

    helpful

  • @S3ANZ13
    @S3ANZ13 2 ปีที่แล้ว

    Thank you for starting with the data format. So many videos and tutorials just assume you've got good clean data.

  • @guragachi7057
    @guragachi7057 2 ปีที่แล้ว

    I have to thumb up this video! thank you!

  • @Stat201atUTK
    @Stat201atUTK 2 ปีที่แล้ว

    Great video Dr. Petrie! Would you be alright STAT 201 using this footage in our videos?

  • @jenniferlee4951
    @jenniferlee4951 2 ปีที่แล้ว

    Thank you for sharing such a wonderful video!

  • @larissacury7714
    @larissacury7714 2 ปีที่แล้ว

    wish we had a part 2!

  • @larissacury7714
    @larissacury7714 2 ปีที่แล้ว

    THANK YOU! I'm wondering about the rescale function from package arm, which / per 2 standard deviations, what changes from the former method?

  • @sangria9052
    @sangria9052 2 ปีที่แล้ว

    Excellent introduction to Shiny Apps. When I first heard about it, I thought it was going to be very complex but it is actually very straight-forward. Definitely a game-changer when it comes to visualising your data.

  • @TyberiasAK
    @TyberiasAK 3 ปีที่แล้ว

    The cat and the lizard at the end of this video had me sitting at the edge of my chair.

  • @newmanokereafor2368
    @newmanokereafor2368 3 ปีที่แล้ว

    Your Video is superb. Clear interpretation Thank you so much.

  • @transontung90
    @transontung90 3 ปีที่แล้ว

    thanks for your videos , great lecture

  • @lanceadambryant
    @lanceadambryant 3 ปีที่แล้ว

    nothing like the smokies

  • @abhishekmajumdar5215
    @abhishekmajumdar5215 3 ปีที่แล้ว

    Soothing is the word that came to my mind after watching. Thanks for the treasure!

  • @Radhikaaa08
    @Radhikaaa08 3 ปีที่แล้ว

    Hi, can you please share the codes or video of how to fit copula meethodology to data in R

  • @zehuizhao1531
    @zehuizhao1531 3 ปีที่แล้ว

    Thank you so much for the tutorial Adam~! Just wondering is there any video teaching us how we can preprocess our messy data in shiny codes, do we just put all the codes in front of the UI?? I am very new to this. Thanks.

    • @AdamPetrie
      @AdamPetrie 3 ปีที่แล้ว

      If this pre-processing only needs to happen once, I'd recommend doing it separately and saving your data into an .RData file, then using load() before the UI load it in. But having all the code that does the preprocessing before the UI is an option as well (but since that code will be run when loading up the app, if that preprocessing takes a very long time, it will take the app a very long time to load!).

    • @zehuizhao1531
      @zehuizhao1531 3 ปีที่แล้ว

      @@AdamPetrie Thank you so much Adam for your response. I wonder when we have a dataset which is not tidy enough, let's say the date variables are not in proper format and Rstudio reads it as character. So if I don't preprocess it, will shiny automatically reads it properly? Sorry for the very basic question.

    • @AdamPetrie
      @AdamPetrie 3 ปีที่แล้ว

      @@zehuizhao1531 I'd love it if shiny new how to process date information correctly when it's read in as characters. But unfortunately it does not. The good news is there's a very easy-to-use package called lubridate that can convert to a date object easy and can extract out the parts you want (day of week, hour of day, etc). I actually have a video for lubridate somewhere on my channel too, but googling it and some examples would be sufficient.

  • @princedobariya9163
    @princedobariya9163 3 ปีที่แล้ว

    great job man! thanks for the lovely tutorial

  • @Gius3pp3K
    @Gius3pp3K 3 ปีที่แล้ว

    Your content is fantastic. I have been trying to develop my R Studio skills for the past year. I wish I found your TH-cam channel months ago. Please keep posting more content as it will help many develop their skills.