similar to: Subset function of lm(); "rolling regressions"

Displaying 20 results from an estimated 900 matches similar to: "Subset function of lm(); "rolling regressions""

2004 Feb 07
1
Subset function of lm() does not seem to work
Folks, I have an elementary question about the lm() function, where I'm trying to exploit the "subset" feature, to make it use only a subset of the observations. My code is: ---------------------------------------------------------------------- A <- read.table(file="datafile.2",
2004 Mar 20
9
Operating on windows of data
I have a data set that is comprised of, for simplicity, a vector of numbers that I want to march across in overlapping windows of say 10 values each, computing a couple of values for each window. Is there a vectorized way to do this, or do I truly need to resort to looping--I think so? Any other clever thoughts? Thanks, Sean [[alternative HTML version deleted]]
2003 Mar 18
2
To load Add-ons
Dear R Help-Team, If I start R and type in search() the result is: [1] ".GlobalEnv" "package:ctest" "Autoloads" "package:base" I often need an Add-on-package. I can load it with "> library(package)" or include a require-command in the .First-function. The .First-function is fine, if I always use the same working directory. But I
2004 Feb 20
9
R: Including R plots in a Microsoft Word document
Greetings List, I am conducting some large simulations using R. As a result, I get many plots but I'm having some trouble with including some of them in a Microsoft Word document. Can any one tell me the easiest method of having copies of the R-graphs in the Word documents? Best regards Mahmoud [[alternative HTML version deleted]]
2003 Jul 24
1
geoR size limit problem
Hi all, I tried to produce some kriged surfaces with geoR (latest version). The size of the grid should be around 900 x 650 cells (what I find is not a very big grid), and the number of points is around 2500. The command krige.conv stopped after arround 5 min saying it can not allocate a vector with around 1.5 billion units. Sounds reasonable. Is there a workaround? How would I partition the
2004 Mar 24
2
geoR - help for bayesian modelling
Hi, I am trying to do a bayesian prediction for soil pollution data above a certain threshold, using geoR. Everything is working fine until i am doing the krig.bayes. I tried to do the prediction on a grid 67 by 113 cells and my computer is freezing to death. At larger numbers of cells it tells me after a while that it reaches the max. memory of 511 Mb. My computer has only 512 Mb of RAM.
2003 Oct 30
3
Change in 'solve' for r-patched
The solve function in r-patched has been changed so that it applies a tolerance when using Lapack routines to calculate the inverse of a matrix or to solve a system of linear equations. A tolerance has always been used with the Linpack routines but not with the Lapack routines in versions 1.7.x and 1.8.0. (You can use the optional argument tol = 0 to override this check for computational
2011 May 04
2
what happens when I store linear models in an array?
I've got a bunch of similar datasets, all of which I've fit to linear models. I'd like to easily create arrays of a specific parameter from each linear model (e.g., all of the intercepts in one array). I figured I'd put the model objects into an array, and then (somehow) I could easily create corresponding arrays of intercepts or residuals or whatever, but I can't the
2007 Aug 31
2
Bugreport on integration of Sweave and latex beamer
I think I have isolated a problem with integration between Sweave and beamer. Could you please see the file: http://www.mayin.org/ajayshah/tmp/bugdemo.Rnw Unfortunately, it uses some of my internal libraries, so you can't run it. When I put it through Sweave, I get: http://www.mayin.org/ajayshah/tmp/bugdemo.tex which is, of course, a generic latex file which you can read and
2009 Mar 15
1
Stuck on building a package
Folks, I have a personal package which used to build fine. Today when I tried to build the package again, some errors popped up. Could you please help? When I paste the offending function into an R it works correctly. But the package build breaks. $ R CMD check ansecon * checking for working pdflatex ... OK * using log directory '/Users/ajayshah/L/R/packages/ansecon.Rcheck' * using R
2005 Jun 07
1
R and MLE
I learned R & MLE in the last few days. It is great! I wrote up my explorations as http://www.mayin.org/ajayshah/KB/R/mle/mle.html I will be most happy if R gurus will look at this and comment on how it can be improved. I have a few specific questions: * Should one use optim() or should one use stats4::mle()? I felt that mle() wasn't adding much value compared with optim, and
2007 May 27
0
Not able to understand the behaviour of boot
Folks, I have a time-series of 875 readings of the weekly returns of a stock market index (India's Nifty). I am interested in the AR(1) coefficient. When I do arima(r, order=c(1,0,0)) I get a statistically significant AR1 coefficient. If we apply the ordinary bootstrap to this problem, this involves sampling with replacement, which destroys the time-series structure. Hence, if we do
2004 Jun 13
0
MCMC tutorials
Hi Ajay: A casual search of google using terms like "MCMC", "Markov Chains", "Monte Carlo", and "tutorial" pulled up over 4000 hits. A few links that may interest you, I thought, like: http://csep1.phy.ornl.gov/CSEP/MC/MC.html http://www.stat.fi/isi99/proceedings/arkisto/varasto/gree0167.pdf http://www.maths.soton.ac.uk/staff/Sahu/utrecht/ ... and so
2007 Oct 28
1
maximizing a function
See http://mayin.nfshost.com/ajayshah/KB/R/documents/mle/mle.html -- Ajay Shah http://www.mayin.org/ajayshah ajayshah at mayin.org http://ajayshahblog.blogspot.com <*(:-? - wizard who doesn't know the answer.
2004 Aug 17
1
An entire data frame which is a time-series?
I have : raw <- read.table("monthly.text", skip=3, sep="|", col.names=c("junk", "junk2", "wpi", "g.wpi", "wpi.primary", "g.wpi.primary", "wpi.fuel", "g.wpi.fuel", "wpi.manuf", "g.wpi.manuf",
2004 May 27
3
Date parsing question
How do I parse a date "yyyymmdd"? I tried asking chron(s, "ymd") but that didn't work. Would the date parsing routines of the Date class of 1.9 grok this? -- Ajay Shah Consultant ajayshah at mayin.org Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi
2008 Oct 15
2
"Heuristic optimisation"?
I wondered was people on this list felt about this article: http://www.voxeu.org/index.php?q=node/2363 which talks about the problems of obtaining sound answers in numerical optimisation in settings such as MLE or NLS. -- Ajay Shah http://www.mayin.org/ajayshah ajayshah at mayin.org http://ajayshahblog.blogspot.com <*(:-? -
2008 Mar 05
1
New data source - now how do we build an R interface?
Folks, A nice new data resource has come up -- http://data.un.org/ I thought it would be wonderful to setup an R function like tseries::get.hist.quote() which would be able to pull in some or all of this data. I walked around a bit of it and I'm not able to map the resources to predictable URLs which can then be wget. There's some javascript going on that I'm not understanding.
2009 Oct 17
2
How do I access with the name of a (passed) function
How would I do something like this: f <- function(x, g) { s <- as.character(g) # THIS DOES NOT WORK sprintf("The %s of x is %.0f\n", s, g(x)) } f(c(2,3,4), "median") f(c(2,3,4), "mean") and get the results "The median of x is 3" "The mean of x is 3" -- Ajay Shah
2005 May 27
1
R commandline editor question
I am using R 2.1 on Apple OS X. When I get the ">" prompt, I find it works well with emacs commandline editing. Keys like M-f C-k etc. work fine. The one thing that I really yearn for, which is missing, is bracket matching When I am doing something which ends in )))) it is really useful to have emacs or vi-style bracket matching, so as to be able to visually keep track of whether I