[R] Converting date variables to integers for regression
Carlos Ortega
carlos.ortega at minorplanet.com
Thu Nov 29 18:56:44 CET 2001
Hello,
Regarding the conversion to integer, you can use through the library "chron"
the equivalent Julian Date associated to each of your "y" values.
I do not know, if the library "date" offers the same kind of possibility.
Regarding the use of dates as objects for regression, I think that is
possible in the "dse" library.
Regards,
Carlos.
-----Mensaje original-----
De: owner-r-help at stat.math.ethz.ch
[mailto:owner-r-help at stat.math.ethz.ch]En nombre de Mark Scarr
Enviado el: miercoles, 28 de noviembre de 2001 23:23
Para: 'R-help at lists.R-project.org'
Asunto: [R] Converting date variables to integers for regression
Hi All,
I am performing some piecewise linear
regression where my X-variable is the date mm/dd/yyyy
stored as a character vector. I would like to convert this
to an integer vector so I can set up dummy variables for the knots
and then perform the regression. Alternatively is it possible to
work with date objects? I was able to use certain binary operators
such as "-" with date objects, but am uncertain if it is possible
to use such objects for regression?
Any help would be most appreciated.
Thanks in advance
Mark.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list