similar to: Take average of previous weeks

Displaying 20 results from an estimated 400 matches similar to: "Take average of previous weeks"

2018 Mar 25
0
Take average of previous weeks
I am sure that this sort of thing has been asked and answered before, so in case my suggestions don't work for you, just search the archives a bit more. I am also sure that it can be handled directly by numerous functions in numerous packages, e.g. via time series methods or by calculating running means of suitably shifted series. However, as it seems to be a straightforward task, I'll
2018 Mar 26
1
Take average of previous weeks
Dear Bert, Thank you very much.This works. I was wondering if the fact that I want to create new variables (sorry for not stating that fact) makes any difference? Thank you again. Sincerely, Milu On Sun, Mar 25, 2018 at 10:05 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > I am sure that this sort of thing has been asked and answered before, > so in case my suggestions
2016 Apr 20
1
Use multiple cores on Linux
I am trying to run the following code in R on a Linux cluster. I would like to use the full processing power (specifying cores/nodes/memory). The code essentially runs predictions based on a GAM regression and saves the results as a CSV file for multiple sets of data (here I only show two). Is it possible to run this code using HPC packages such as Rmpi/snow/doParallel? Thank you!
2004 Feb 17
4
importing ascii grids (for gstat)
Hello, Is there anyone who could give me an example of how to import an ascii grid (i.e. ArcGIS exported raster) into R. I want to use it with gstat but don't know the appropriate import routine. Thanks very much for your help. Regards, femke Femke Reitsma Graduate Student (ABD) Geography Department 2181 LeFrak Hall University of Maryland College Park, MD 20742 Phone: 301-405-4121
2008 Aug 11
3
Peoblem with nls and try
Hello, I can`t figure out how can increase the velocity of the fitting data by nls. I have a long data .csv I want to read evry time the first colunm to the other colunm and analisy with thata tools setwd("C:/dati") a<-read.table("Normalizzazione.csv", sep=",", dec=".", header=F) for (i in 1:dim(a[[2]]]) { #preparazione dati da analizzare
2009 Oct 26
1
fit an exponential curve
Dear useRs, I have the following plot: pos <- c(27/44, 11/32, 8/40, 4/42, 3/40, 4/40, 2/40) tmin <- c(15.8, 12.6, 10.5, 2.4, 5.2, 8.5, 7.9) plot(tmin, pos) I would like to fit an exponential curve to it. How could I be able to do this? Thanks in advance, Rafael. ____________________________________________________________________________________ [[elided Yahoo spam]]
2011 Nov 30
2
forecasting linear regression from lagged variable
I'm currently working with some time series data with the xts package, and would like to generate a forecast 12 periods into the future. There are limited observations, so I am unable to use an ARIMA model for the forecast. Here's the regression setup, after converting everything from zoo objects to vectors. hire.total.lag1 <- lag(hire.total, lag=-1, na.pad=TRUE) lm.model <-
2005 Jan 31
2
coercing a list to a data frame, lists in foreloops
I have a set of time-series climate data with missing entries. I need to add rows for these missing entries to this data set. The only way I know to do this is unsing a foreloop, but this won't work on a list. I've tried to convert the list to a data frame, but that won't happen, either. I want to fill rows in this table: > newtest[10:15,] yrmos yearmo snow.sum snow.mean
2012 Mar 19
3
Issue with asin()
Hello everyone, I am working for a few days already on a basic algorithm, very common in applied agronomy, that aims to determine the degree-days necessary for a given individual to reach a given growth stade. The algorithm (and context) is explained here: http://www.oardc.ohio-state.edu/gdd/glossary.htm , and so I implemented my function in R as follows: DD <- function(Tmin, Tmax, Tseuil,
2018 Jun 19
3
Paquete dismo, cálculo coeficiente de variación
Estimados erreros, Estoy intentando entender como calcula el paquete dismo ( https://cran.r-project.org/web/packages/dismo/index.html) un coeficiente de variación. Os pongo un ejemplo: tmin <- c(10,12,14,16,18,20,22,21,19,17,15,12) # temperatura mínima media mensual de un año tmax <- tmin + 5 # temperatura máxima media mensual de un año prec <- c(0,2,10,30,80,160,80,20,40,60,20,0)
2013 Apr 26
1
Regression coefficients
Hi all, I have run a ridge regression as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617 smallest value of GCV at 10 I think it means that it is
2002 Jun 20
1
Possible bug with glm.nb and starting values (PR#1695)
Full_Name: Ben Cooper Version: 1.5.0 OS: linux Submission from: (NULL) (134.174.187.90) The help page for glm.nb (in MASS package) says that it takes "Any other arguments for the glm() function except family" One such argument is start "starting values for the parameters in the linear predictor." However, when called with starting values glm.nb returns: Error in
2012 Jul 06
3
estimating NA values against selected slots
Dear R Users, Could you please help me on the following issue? I have a real large yearly data set. For each year I have 365 flow values. Some of the flow values are not known and that’s why you will see NA written in those slots. I wanted to know, is there a way that I can estimate those values? I tried approx command but it seems least helpful for the kind of issue I am up against.
2012 Feb 03
1
A question on Unit Root Test using "urca" toolbox
Hello, I have a question on unit root test with urca toolbox. First, to run a unit root test with lags selected by BIC, I type: > CPILD4UR<-ur.df(x1$CPILD4[5:nr1], type ="drift", lags=12, selectlags ="BIC") > summary(CPILD4UR) The results indicate that the optimal lags selected by BIC is 4. Then I run the same unit root test with drift and 4 lags:
2013 Apr 27
1
Selecting ridge regression coefficients for minimum GCV
Hi all, I have run a ridge regression as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617 smallest value of GCV at 10 I think it means that it is advisable to
2018 Jun 19
2
Paquete dismo, cálculo coeficiente de variación
Hola, en la misma definici?n de la funci?n: # P15. Precipitation Seasonality(Coefficient of Variation) # the "1 +" is to avoid strange CVs for areas where mean rainfaill is < 1) p[,15] <- apply(prec+1, 1, cv) Un saludo, Jorge On Martes, 19 de Junio de 2018 13:07:27 Marcelino de la Cruz Rot escribi?: > Hola Jaume: > > Si miras el c?digo de biovars() ver?s que la
2004 Oct 29
2
lag variable addition to data frame question
Hi, I was wondering if there is a more efficient way of handling the following method of creating a lagged value in a data frame without using the recursive 'for(i in 1:n)' loop and without using as.ts #Steps to creating a lag variable in a data frame 'my.dat.fr' # with 275 columns, 2400 rows of numbers and factors . The #variable x is a factor of #with five different levels the
2012 Aug 27
1
How to average time series data around regular intervals
Hi, I'm pretty new to R and have run into a task which although I'm certain is within R's capabilities, falls outside of mine. :-) Consider the following data set: 2012-07-22 12:12:00, 21 2012-07-22 12:15:00, 22 2012-07-22 12:18:00, 24 2012-07-22 12:39:00, 21 2012-07-22 12:45:00, 25 2012-07-22 12:49:00, 26 2012-07-22 12:53:00, 20 2012-07-22 13:00:00, 18 2012-07-22 13:06:00, 22 My
2012 Mar 19
1
Lag based on Date objects with non-consecutive values
Hello all, I need to figure out a way to lag a variable in by a number of days without using the zoo package. I need to use a remote R connection that doesn't have the zoo package installed and is unwilling to do so. So that is, I want a function where I can specify the number of days to lag a variable against a Date formatted column. That is relatively easy to do. The problem arises when I
2009 Jul 12
1
variance explained by each predictor in GAM
Hi, I am using mgcv:gam and have developed a model with 5 smoothed predictors and one factor. gam1 <- gam(log.sp~ s(Spr.precip,bs="ts") + s(Win.precip,bs="ts") + s( Spr.Tmin,bs="ts") + s(P.sum.Tmin,bs="ts") + s( Win.Tmax,bs="ts") +factor(site),data=dat3) The total deviance explained = 70.4%. I would like to extract the variance explained