John Sorkin
2016-Aug-24 22:00 UTC
[R] function that converts data into a form that can be included in a question to mailing list
There is a function that can be used to convert data structures such as a data frame into a different format that allows the data to be sent to the mailing list. The structure that is created can be used to easily reconstruct the data structure. Unfortunately, I don't remember the function that is called on the data structure. Can someone remind me? Thank you John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Confidentiality Statement: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Jim Lemon
2016-Aug-24 22:04 UTC
[R] function that converts data into a form that can be included in a question to mailing list
Hi John, I think it is "dput". Jim On Thu, Aug 25, 2016 at 8:00 AM, John Sorkin <jsorkin at grecc.umaryland.edu> wrote:> > There is a function that can be used to convert data structures such as a data frame into a different format that allows the data to be sent to the mailing list. The structure that is created can be used to easily reconstruct the data structure. Unfortunately, I don't remember the function that is called on the data structure. Can someone remind me? > Thank you > John > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for ...{{dropped:12}}
David Winsemius
2016-Aug-24 22:11 UTC
[R] function that converts data into a form that can be included in a question to mailing list
> On Aug 24, 2016, at 3:00 PM, John Sorkin <jsorkin at grecc.umaryland.edu> wrote: > > > There is a function that can be used to convert data structures such as a data frame into a different format that allows the data to be sent to the mailing list. The structure that is created can be used to easily reconstruct the data structure. Unfortunately, I don't remember the function that is called on the data structure. Can someone remind me?ITYM dput() -- David> Thank you > John > John David Sorkin M.D., Ph.D. >David Winsemius Alameda, CA, USA
John Sorkin
2016-Aug-24 22:12 UTC
[R] function that converts data into a form that can be included in a question to mailing list
Jim, Yes, you are correct! Give yourself a pat on the back and a gold start THANK YOU, John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing)>>> Jim Lemon <drjimlemon at gmail.com> 08/24/16 6:05 PM >>>Hi John, I think it is "dput". Jim On Thu, Aug 25, 2016 at 8:00 AM, John Sorkin <jsorkin at grecc.umaryland.edu> wrote:> > There is a function that can be used to convert data structures such as a data frame into a different format that allows the data to be sent to the mailing list. The structure that is created can be used to easily reconstruct the data structure. Unfortunately, I don't remember the function that is called on the data structure. Can someone remind me? > Thank you > John > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.Confidentiality Statement: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Bert Gunter
2016-Aug-24 22:17 UTC
[R] function that converts data into a form that can be included in a question to mailing list
?dput Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Aug 24, 2016 at 3:00 PM, John Sorkin <jsorkin at grecc.umaryland.edu> wrote:> > There is a function that can be used to convert data structures such as a data frame into a different format that allows the data to be sent to the mailing list. The structure that is created can be used to easily reconstruct the data structure. Unfortunately, I don't remember the function that is called on the data structure. Can someone remind me? > Thank you > John > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for ...{{dropped:12}}
John Sorkin
2016-Aug-24 22:33 UTC
[R] function that converts data into a form that can be included in a question to mailing list
I am trying to run a repeated measures analysis of data in which each subject (identified by SS) has 3 observations at three different times (0, 3, and 6). There are two groups of subjects (identified by group). I want to know if the response differs in the two groups. I have tried to used lme. Lme tell me if there is a time effect, but does not tell me if there is a group effect. Once I get this to work I will want to know if there is a significant group*time effect. Can someone tell me how to get an estimate for group. Once I get that, I believe getting an estimate for group*time should be straight forward. The code I have tired to use follows. Thank you, John> data1SS group time value baseline 1 1 Cont 0 6.000000 6.000000 2 2 Cont 0 3.000000 3.000000 3 3 Cont 0 5.000000 5.000000 4 4 Inte 0 14.132312 14.132312 5 5 Inte 0 8.868808 8.868808 6 6 Inte 0 14.602672 14.602672 7 1 Cont 3 10.706805 6.000000 8 2 Cont 3 8.469477 3.000000 9 3 Cont 3 9.337411 5.000000 10 4 Inte 3 16.941940 14.132312 11 5 Inte 3 13.872662 8.868808 12 6 Inte 3 20.465614 14.602672 13 1 Cont 6 16.687028 6.000000 14 2 Cont 6 13.177752 3.000000 15 3 Cont 6 14.276398 5.000000 16 4 Inte 6 23.453808 14.132312 17 5 Inte 6 18.229053 8.868808 18 6 Inte 6 25.334664 14.602672> # Create a grouped data object. SS identifies each subject > # group indentifies group, intervention or control. > GD<- groupedData(value~time|SS/group,data=data1,FUN=mean) > # Fit the model. > fit1 <- lme(GD) > cat("The results give information about time, but does not say if the gruops are different\n")The results give information about time, but does not say if the gruops are different> summary(fit1)Linear mixed-effects model fit by REML Data: GD AIC BIC logLik 81.38094 88.33424 -31.69047 Random effects: Formula: ~time | SS Structure: General positive-definite StdDev Corr (Intercept) 3.371776404 (Intr) time 0.009246535 1 Formula: ~time | group %in% SS Structure: General positive-definite StdDev Corr (Intercept) 3.34070367 (Intr) time 0.00915754 1 Residual 0.61279061 Fixed effects: value ~ time Value Std.Error DF t-value p-value (Intercept) 8.512446 1.9511580 11 4.362766 0.0011 time 1.654303 0.0592047 11 27.942107 0.0000 Correlation: (Intr) time -0.001 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -1.9691671 -0.4876710 0.1559464 0.4637269 1.6069444 Number of Observations: 18 Number of Groups: SS group %in% SS 6 6 John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Confidentiality Statement: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.