Closed ebmtnprof closed 5 years ago
Yes, you removed it when you called:
select(obs_0:p_d1_1)
thanks, but that appears to be required in order to use any of the other tidyLPA functions? If I don't use select, then "dyad" (and any other variables in the dataframe) is used in the lpa solution, which is not appropriate. In the prior version of tidyLPA, one selected the variables to be used in the lpa process, but then could recover the full data set, along with the profiles, with get_data. That is what appears to not work anymore.... Thanks for any help with this. I can code up a work-around hack if necessary, but it would be much simpler if the new version of tidyLPA just did the same thing as the old version, which was perfect.... :) Thanks again for your efforts on this! Cheers, Emily
On Fri, Apr 12, 2019 at 11:45 PM C. J. van Lissa notifications@github.com wrote:
Yes, you removed it when you called:
select(obs_0:p_d1_1)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/data-edu/tidyLPA/issues/112#issuecomment-482782183, or mute the thread https://github.com/notifications/unsubscribe-auth/AkNSOv8LBwBHpnPqKbPvAHfBeMrDAB6vks5vgX0agaJpZM4csmGF .
Emily A. Butler
Professor & Graduate Director Family Studies and Human Development College of Agriculture & Life Sciences University of Arizona Tucson, AZ, 85721-0033
Dear Emily, these changes are documented extensively. We've made the package more in line with the fundamental philosophy underlying R: Each function should fulfill one clear goal.
In this case, that goal is to estimate profiles. Functionality to select variables already existed, in the form of the select() function. It was awkward that the previous version of estimate_profiles used the ... argument internally to call select(), instead of actually passing on arguments from ... down to the core estimation function, which it is intended for. Functionality to join data.frames exists too; there are many options. In base R:
test <- cbind(params, get_data(lpa1))
Or if you just want one variable,
test <- get_data(lpa1)
test$dyad <- params$dyad
ok, thanks for the reply. I'll do my own data merging after the fact. There are some complexities in lining up the data accurately after the fact, which is why I was hoping for the same behavior as the previous version of tidyLPA, which by-passed the issues. But I know how to merge dataframes.... Cheers, Emily
On Sat, Apr 13, 2019 at 9:27 AM C. J. van Lissa notifications@github.com wrote:
Dear Emily, these changes are documented extensively. We've made the package more in line with the fundamental philosophy underlying R: Each function should fulfill one clear goal.
In this case, that goal is to estimate profiles. Functionality to select variables already existed, in the form of the select() function. It was awkward that the previous version of estimate_profiles used the ... argument internally to call select(), instead of actually passing on arguments from ... down to the core estimation function, which it is intended for. Functionality to join data.frames exists too; there are many options. In base R:
test <- cbind(params, get_data(lpa1))
Or if you just want one variable,
test <- get_data(lpa1) test$dyad <- params$dyad
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/data-edu/tidyLPA/issues/112#issuecomment-482832435, or mute the thread https://github.com/notifications/unsubscribe-auth/AkNSOmfJ0biBHq4KpLqkU5w0bjZwbTniks5vggWCgaJpZM4csmGF .
Emily A. Butler
Professor & Graduate Director Family Studies and Human Development College of Agriculture & Life Sciences University of Arizona Tucson, AZ, 85721-0033
Dear Emily, there should not be any complexities. The data.frame returned by get_data is always in exactly the same order as the input, so you can simply add columns.
thanks for the additional response. The complexities are on my end. I have 3 levels of nesting that needs to be preserved, and it all needs to replicate across all the profiles, the number of which will vary each time someone using my package uses it (I am using tidyLPA within a larger package of my own, so in essence I am wrapping your wrappers :) ). The previous version of tidyLPA just made it all easy for me, where now I have to do some additional coding on my end. Thanks for a great package though! You are still saving me large amounts of time and effort. You may want to update your documentation though (see last section of "Introduction to tidyLPA") which still says get_data will return the entire data set, including variables not used by estimate_profiles. Cheers, Emily
On Sat, Apr 13, 2019 at 11:01 PM C. J. van Lissa notifications@github.com wrote:
Dear Emily, there should not be any complexities. The data.frame returned by get_data is always in exactly the same order as the input, so you can simply add columns.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/data-edu/tidyLPA/issues/112#issuecomment-482922501, or mute the thread https://github.com/notifications/unsubscribe-auth/AkNSOjH47FOGajuN2tiuVO-Oe0XVELKVks5vgsREgaJpZM4csmGF .
Emily A. Butler
Professor & Graduate Director Family Studies and Human Development College of Agriculture & Life Sciences University of Arizona Tucson, AZ, 85721-0033
Hi again - Sorry to be a thorn in your side, but.... I am trying to use get_data to retrieve the original dataframe, along with the profile membership information. It used to work just fine, but now I am not getting all the variables back. In the example below (data attached), I need the "dyad" variable that is in the original data to be returned, but it is disappearing. Help??? !! Many thanks.... Cheers, Emily BTW - this is issue is much more important to me than the imputation one.... I can't do anything without being able to solve this one, but the imputation is just a nicety I can do without. params.xlsx
head(params) # you can see that "dyad" is the last column lpa1 <- params %>% select(obs_0:p_d1_1) %>% estimate_profiles(2) test <- get_data(lpa1) head(test) # you can see that "dyad" is not there