Re: [R] Running segmented on grouped data and collating model parameters in a data frame

2018-06-04 Thread Vito M. R. Muggeo
dear Sumi, I am not familiar with the dplyr package (%>%..), however if you want to fit the model for each subject times freq interaction, a simple for loop will suffice. Here possible code: Assuming d is the dataframe, something like subj<-levels(d$subject) fr<-unique(d$freq) #new dataframe

[R] Running segmented on grouped data and collating model parameters in a data frame

2018-06-03 Thread Sumitrajit Dhar
Hi Folks, I am trying to teach myself how to solve the problem described below but am running out of time. Hence the plea for help. Thanks in advance. Here is my data frame. > t # A tibble: 12 x 12 subject ageGrp ear hearingGrp sexfreqL2 Ldp PhidpNF SNR Ldp_p