Displaying 20 results from an estimated 30000 matches similar to: "Repeated regressions"
2003 Aug 13
1
Problems with addition in big POSIX dates
Have you noticed any problems with big dates (>=1/1/2040) in R?
Here is the bit of code that I'm having trouble with:
> test.date <- strptime("1/1/2040",format="%m/%d/%Y")
>
> unlist(test.date)
sec min hour mday mon year wday yday isdst
0 0 0 1 0 140 0 0 0
>
> date.plus.one <- as.POSIXct(test.date) +
2017 Jan 03
2
[R] Problems when trying to install and load package "rzmq"
On Tue, Jan 3, 2017 at 3:53 PM, Whit Armstrong <armstrong.whit at gmail.com> wrote:
>
> I maintian the rzmq project.
>
> love to get it running on windows, but zmq doesn't play nicely with R's
> mingw.
It's fairly easy to link against the libraries from rwinlib:
https://github.com/rwinlib/zeromq. I'll send you a pull request later
this week to fix the binary
2004 Oct 25
1
copyright issues when package maintainer changes
I will be taking over as maintainer of the its package from Giles Heywood.
The code was originally written while he was working at Commerzbank. I have
added the header below to the top of the R source file to indicate the
changes in the copyrights for the code. The package was originally released
under GPL2. I have no experience with copyright issues, and would
appreciate it if someone who does
2004 Sep 09
4
scoping rules
Can someone help me with this simple example?
sq <- function() {
y <- x^2
y
}
myfunc <- function() {
x <- 10
sq()
}
myfunc()
executing the above in R yields:
> myfunc()
Error in sq() : Object "x" not found
I understand that R's scoping rules cause it to look for "x" in the
environment in which "sq" was defined (the global environment in
2004 Feb 09
1
Subset function of lm(); "rolling regressions"
Folks,
I asked a question on this mailing list about the subset support of
lm(). In a flash, I got three helpful responses from
Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net>
Erin Hodgess <hodgess at gator.uhd.edu>
and
Peter Dalgaard <p.dalgaard at biostat.ku.dk>
:-) and it was just great.
The mistake I was making was in not understanding the notion of a
2005 Mar 02
2
apply a function to a rolling subset of a vector
Try this:
> ?convolve
> x<-rnorm(1000)
> y<-rep(1,20)
> z<-convolve(x,y,type="filter")
> plot(x,type="l")
> str(z)
num [1:981] 6.31 7.28 8.16 7.39 4.65 ...
> lines(c(rep(0,10),z,rep(0,10)),col="yellow",lwd=3)
> lines(c(rep(0,10),z,rep(0,10))/length(y),col="red",lwd=3) #running mean
You wrote:
Does anyone know an easy way
2006 Sep 22
2
behavior of [<-.foo
Can someone help me understand the following behavior of "[<-" ?
If I define a simple class based on a matrix, the [<- operation only
inserts into the first column:
> x <- matrix(rnorm(10),nrow=5,ncol=2)
> class(x) <- "foo"
> "[<-.foo" <- function(x, i, j, value) {
+ if(missing(i)) i <- 1:nrow(x)
+ if(missing(j)) j <-
2006 Aug 28
1
Help on function adf.test
Hello everybody,
I've got a matrix called EUROPEDATA and I want to calculate the adf test statistic (part of the tseries package) on a rolling basis for window my.win on each column; i.e. each column of EUROPEDATA represents a particular variable; for the first column I calculate the adf test statistic for window my.win = 60 for example, roll forward one observation, calculate the adf
2004 Jan 12
1
question about how summary.lm works
Hi,
While exploring how summary.lm generated its output I came across a section
that left me puzzled.
at around line 57
R <- chol2inv(Qr$qr[p1, p1, drop = FALSE])
se <- sqrt(diag(R) * resvar)
I'm hoping somebody could explain the logic of these to steps or
alternatively point me in the direction of a text that will explain these
steps.
In particular I'm puzzled
2005 Sep 13
1
possible bug in model.matrix
Is this a bug, or have I misunderstood the proper use of lm?
Thanks,
Whit
code:
x <- rnorm(50)
y <- matrix(as.logical(round(runif(100),0)),ncol=2)
NROW(x)==NROW(y)
lm(x~y)
> x <- rnorm(50)
> y <- matrix(as.logical(round(runif(100),0)),ncol=2)
> NROW(x)==NROW(y)
[1] TRUE
> lm(x~y)
Error in "[[<-.data.frame"(`*tmp*`, nn, value = c(2, 1, 2, 1, 1, 1, 2,
:
2002 Feb 22
1
Weekdays
Hello,
I'm trying to write a function that returns the number of weekdays between a
vector of start dates and a vector of end dates.
Subtracting the 2 times the number of whole weeks is the easy part and works
if the number of days is a multiple of 7.
However, the number of weekend days in the tail is a little harder. It
depends on both the start date of the tail and the number of days in
2002 Feb 22
1
Visual Basic: calling compiled VB code from R
Hello,
Any advice on calling Visual Basic code from R would be helpful.
Thanks,
Whit Armstrong
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
2003 Sep 17
3
Building and loading a DLL on Windows NT
I am trying to build a simple dll with Rcmd SHLIB to link into R. The
results of the build are below. From my limited knowledge of building DLLs,
it looks like it worked (I didn't get any errors).
F:\R\dlls> Rcmd SHLIB add.C
making add.d from add.C
g++ -IC:/PROGRA~1/R/src/include -Wall -O2 -c add.C -o add.o
ar cr add.a *.o
ranlib add.a
g++ --shared -s -o add.dll add.def add.a
2006 Aug 31
0
Moving Window regressions with corrections for Heteroscedasticity and Autocorrelations(HAC)
# Using Moving/Rolling Windows, here we do an OLS Regression with corrections for #Heteroscedasticity and Autocorrelations (HAC) using Newey West Method. This code is a #extension of Ajay Shah?s code for moving windows simple OLS regression.
# The easiest way to adjust for Autocorrelations and Heteroscedasticity in the OLS residuals is to #use the coeftest function that is included in the
2003 Dec 31
2
Calling primitive functions from C code
Does anyone have an example of calling primitive or internal functions from
C code that they would share with me?
I am having trouble trying to figure out how to construct the proper
arguments to pass to "do_subset_dflt"
Here is the prototype:
SEXP do_subset_dflt(SEXP call, SEXP op, SEXP args, SEXP rho);
The R_FunTab from "names.c" gives some additional information on the
2003 Dec 31
2
Calling primitive functions from C code
Does anyone have an example of calling primitive or internal functions from
C code that they would share with me?
I am having trouble trying to figure out how to construct the proper
arguments to pass to "do_subset_dflt"
Here is the prototype:
SEXP do_subset_dflt(SEXP call, SEXP op, SEXP args, SEXP rho);
The R_FunTab from "names.c" gives some additional information on the
2004 Aug 19
2
proposed change to [.POSIXct
R developers,
The "tzone" attribute is stripped from a POSIXct object when the subscript
command is called ("[.POISXct"). This results in dates being printed in the
locale specific format after a subscript operation is applied to a POSIXct
object which has cause several problems for me in the past.
Here is an example of this problem under R 1.9.1:
> x <-
2008 Aug 02
1
problem with nested loop for regression
Hi everyone,
I'm experiencing difficulty getting the results I want when I use a nested
for loop. I have a data set to which I perform some calculations, and then
try to apply a regression over a rolling window. The code runs, but the
regression results I am getting (intercept and slope) are simply the same,
repeated again and again in the results matrix. The regression does not seem
to be
2008 Nov 18
2
anyone familiar with this error?
[whit at linuxsvr R.packages]$ sudo R CMD INSTALL portfolio.construction
* Installing to library '/usr/local/lib64/R/library'
* Installing *source* package 'portfolio.construction' ...
** R
** preparing package for lazy loading
Loading required package: fts
Loading required package: quadprog
Loading required package: Rexcelpoi
terminate called after throwing an instance of
1998 May 29
0
aov design questions
R developers,
I have a first attempt to make an aov function. Eventually I want to
build in Error() structure, but first I am trying to get this
presentable for balanced data with only a single stratum, just using
residual error. I am following R. M. Heiberger's Computation for the
Analysis of Designed Experiments, Wiley (1989)
I a using a wrapper (aov.bal) to call the