Re: [R] A question on modeling brain growth using GAM

2017-04-07 Thread Leon Lee
Simon I wonder whether I can take advantage of this thread and ask you another related question. Now, I want to get the 95%CI of the fit and their derivatives as well. For the original fitted curves, It is straightforward as the option "type=terms" can be used to get the CI for the fixed effect. N

Re: [R] problems in vectors of dates_times

2017-04-07 Thread Richard M. Heiberger
Don asks a good question. Here is the analogy from the grid package. > library(grid) > unit(12, "in") [1] 12in > unit(12, "cm") [1] 12cm > unit.c(unit(12, "in"), unit(12, "cm")) [1] 12in 12cm > c(unit(12, "in"), unit(12, "cm")) [1] 12 12 > ?unit > convertUnit(c(unit(12, "in"), unit(12, "cm")), "i

Re: [R] problems in vectors of dates_times

2017-04-07 Thread MacQueen, Don
I think a more illuminating inspection is this: > attributes(A) $class [1] "POSIXct" "POSIXt" $tzone [1] "UTC" > attributes(B) $class [1] "POSIXct" "POSIXt" $tzone [1] "UTC" > attributes(C) $class [1] "POSIXct" "POSIXt" Note that the operation c(A,B) loses the $tzone attribute. Note also

Re: [R] Is there a way to get R script line number

2017-04-07 Thread MacQueen, Don
Possible clarification/correction...(apologies in advance if I'm being redundant) If I put the following four lines in a script whose file name is "junk.r": log(3) log(4) log('a') log(5) then it generates an error message, as expected: > source('junk.r') Error in log("a") (from junk.r#3) : non

Re: [R] Paired sample t-test with mi.t.test

2017-04-07 Thread Prof. Dr. Matthias Kohl
Dear Joel, are you trying to apply function mi.t.test from my package MKmisc? Could you please try: mi.t.test(implist, "pre_test", "post_test", alternative = "greater", paired = TRUE, var.equal = TRUE, conf.level = 0.95) x and y are the names of the variables, not the variables themselves. Bes

Re: [R] Piecewise continuous Poisson regression

2017-04-07 Thread Achim Zeileis
On Fri, 7 Apr 2017, Sorkin, John wrote: Is there an R package that will perform a piecewise continuous Poisson regression? I want to model two linear segments that intersect at a common knot. The "segmented" package implements such broken stick regressions based on either "lm" or "glm" model

Re: [R] Add local image as inline embedded Image

2017-04-07 Thread Jeff Newmiller
a) The email I am replying to should have been a reply to your original email [1]... it is not a complete picture of your problem, and you are not maintaining a thread of conversation. b) I don't compose emails in R so I don't know what R package(s) you should use/look for. I recommend package

Re: [R] list with element "Class 'Date' num"

2017-04-07 Thread Jeff Newmiller
On Thu, 6 Apr 2017, Tintin wrote: Hi How do I create an element with specificiation " Class 'Date' num " The problem arises when I try to construct my own data structure set in the "termstrc" package. The model list should look like: R> str(govbonds$GERMANY) List of 8 $ ISIN : chr [1:52] "DE0

Re: [R] difference metric info of same font on different device

2017-04-07 Thread Jeff Newmiller
I think it is a fundamental characteristic of graphics drivers that output will look different in the details... you are on a wild goose chase. Postscript in particular has a huge advantage in font presentation over other graphics output mechanisms. -- Sent from my phone. Please excuse my brev

Re: [R] Piecewise continuous Poisson regression

2017-04-07 Thread Vito Michele Rosario Muggeo
dear John, The package segmented can help you. ?plot.segmented includes a Poisson example best, vito "Sorkin, John" ha scritto: Is there an R package that will perform a piecewise continuous Poisson regression? I want to model two linear segments that intersect at a common knot. Thank

Re: [R] average at specific hour "endpoints" of the day

2017-04-07 Thread Massimo Bressan
hi jeff thank you for your code, there is lot to think about it... In the meanwhile I've managed to work out a (sort of) solution but I'm still not completely satisfied with it I would like to keep it all more elegant and possibly general here it is, so far... mydate<-seq(ISOdatetime(20

Re: [R] readr to generate tibble from a character matrix

2017-04-07 Thread Ben Tupper
Thanks! I made up a little test for converting from character matrix to tibble: dumping to file and reading back, pasting up a big string, using pipes, using as.data.frame and using a pipeless version. By far and away it is worth using Ulrik's or your solution compared to dumping the matrix to

[R] Content Management System Built on R

2017-04-07 Thread Steven Nagy
Hi everyone, I'm still new to R, and I like that's it's so compact, you can do so much in just a few lines of code. I wondered if there is any Content Management System built on R. I have created websites for my clients, and I prefer to set it up in a CMS instead and give them control to edit

Re: [R] Paired sample t-test with mi.t.test

2017-04-07 Thread Gerrit Eichner
Hi, Joel, I think, according to the help page of mi.t.test, mi.t.test(implist, x = "pre_test", y = "post_test", alternative = "greater", paired = TRUE, var.equal = TRUE, conf.level = 0.95) should do it (untested). Hth -- Gerrit --

Re: [R] Is there a way to get R script line number

2017-04-07 Thread William Michels via R-help
Hi Brad, Some of the debugging functions may be of use. You can look at trace() or setBreakpoint(). But I believe Bert is correct in saying your concept of a "Line Number" and R's concept of a "Line Number" will differ. Finally, you can look at the function findLineNum(), which can be called exte

[R] Piecewise continuous Poisson regression

2017-04-07 Thread Sorkin, John
Is there an R package that will perform a piecewise continuous Poisson regression? I want to model two linear segments that intersect at a common knot. Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicin

[R] difference metric info of same font on different device

2017-04-07 Thread Jinsong Zhao
Hi there, I try to plot with custom fonts, which have good shape Latin and CJK characters. I set up all the fonts correctly. However, when I plot the same code on png() and postscript(), I get different result. The main problem is the space between characters is narrower in postscript() than

Re: [R] A question on modeling brain growth using GAM

2017-04-07 Thread Leon Lee
Hi, Simon Thank you for your explanation! I followed the instructions and successfully get the predicted values with both fixed and random effects incorporated: pred.new=predict.gam(gamm1$gam,newdata,type="response"). Also, what I meant to say was "plot(gamm1$gam, pages=1)" for left and right fig

[R] list with element "Class 'Date' num"

2017-04-07 Thread Tintin
Hi How do I create an element with specificiation " Class 'Date' num " The problem arises when I try to construct my own data structure set in the "termstrc" package. The model list should look like: R> str(govbonds$GERMANY) List of 8 $ ISIN : chr [1:52] "DE0001141414" "DE0001137131" "DE0001141

[R] Paired sample t-test with mi.t.test

2017-04-07 Thread Joel Gagnon
Dear all, It is my first time posting on this list so forgive me for any rookie mistakes I could make. I want to conduct t-tests on a dataset that has been imputed using the mice package: imput_pps <- mice(pps, m=20, maxit=20, meth='pmm') # pps is my dataset. It contains items from an 11-item que

Re: [R] problems in vectors of dates_times

2017-04-07 Thread William Michels via R-help
I believe the lubridate package does a good job with time zones. > install.packages("lubridate") > library(lubridate) Look at the supplied functions with_tz() and force_tz(). HTH, Bill. William J. Michels, Ph.D. On Fri, Apr 7, 2017 at 12:52 AM, Jeff Newmiller wrote: > R does a poor job

Re: [R] problems in vectors of dates_times

2017-04-07 Thread Jeff Newmiller
R does a poor job of supporting timezone-specific objects... you have to transfer the necessary attributes explicitly for many operations. (It does no job of supporting element-specific timezones so don't go there.) The good news is that R is pretty good at working with points in time, since t

Re: [R] problems in vectors of dates_times

2017-04-07 Thread Troels Ring
Thanks a lot - good idea: I put Sys.setenv(TZ = "UTC") ahead of the code - solves the problem! Thanks a lot Den 07-04-2017 kl. 09:26 skrev Mark Leeds: > Hi Troels: This is off-list so as to not clog the list with my noise > because my suggestion may not work. I really don't know that much >

Re: [R] problems in vectors of dates_times

2017-04-07 Thread Troels Ring
Thanks a lot - perhaps it is just understanding how times dates are handled, sorry to bother if that is just the case C[1]==A[1] # TRUE but C[1] [1] "2013-03-28 07:00:00 CET" A[1] [1] "2013-03-28 06:00:00 UTC" Den 07-04-2017 kl. 08:27 skrev Ulrik Stervbo: Hi Troels, I get no error. I