Within-group regression using {purrr} | TidyX Episode 183

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.ย. 2024
  • TidyX Episode 183: Within-group regression using {purrr}
    Unleash the power of {purrr} to perform within-group regressions! This episode we'll explore fitting separate linear models for different groups in your data, using the Palmer Penguins dataset as an example. Using map(), we'll quickly build models, extract key statistics, and visualize how groups differ. Join us to start the journey on master this great package and become a {purrr}fect data scientist!
    Join us for an episode that will have your simulations running at the speed of light! ️
    Like, Subscribe, and find us on social media! (@ellis_hughes, @OSPpatrick, @tidy_explained).
    If you like what we are doing, please sign up to be a patron on Patreon!
    / tidy_explained
    Email us with any comments, questions, or suggestions at tidy.explained@gmail.com.
    Links:
    Open an issue on the TidyX Github page!
    github.com/the...
    Patreon:
    / tidy_explained
    TidyX Code:
    github.com/the...

ความคิดเห็น • 3

  • @liangzhao2659
    @liangzhao2659 3 หลายเดือนก่อน

    Great job!

  • @djangoworldwide7925
    @djangoworldwide7925 2 หลายเดือนก่อน +1

    You can try use the \(df) notation for anon functions.
    purrr::map(my_list, \(df) lm(y~x1+X2, data = df))
    This function expects a list of data frames called my_list.
    It then regress in each of these data frames y against x1+x2, and specifies each of the data frames in the list as the data for the regression.
    It is the same as what you guys did, but i think this notation was introduced and is now considered better than ~ .x notation

  • @hosseinkhandani3937
    @hosseinkhandani3937 2 หลายเดือนก่อน

    Why was the panel data package (plm) or LSDV Reg method not used?