similar to: How to rename the columns of as.table

Displaying 20 results from an estimated 100 matches similar to: "How to rename the columns of as.table"

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 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:
2008 May 22
1
How to account for autoregressive terms?
Hi, how to estimate a the following model in R: y(t)=beta0+beta1*x1(t)+beta2*x2(t)+...+beta5*x5(t)+beta6*y(t-1)+beta7*y(t-2)+beta8*y(t-3) 1) using "lm" : dates &lt;- as.Date(data.df[,1]) selection&lt;-which(dates&gt;=as.Date("1986-1-1") &amp; dates&lt;=as.Date("2007-12-31")) dep &lt;- ts(data.df[selection,c("dep")]) indep.ret1
2023 Jan 16
1
(no subject)
Dear Members, Greetings! I would like to know how to create the lag variable for my data. # Load data and create time series object ---- oil <- read_xlsx("crudefinal.xlsx") pricet=ts(oil$price, start = c(2020, 22), frequency = 365) roilt=ts(diff(log(oil$price))*100,start=c(2020,22),freq=365) # Fit MSW model ---- roilt.lag0 =
2007 Jul 12
2
lead
Hi, is there any function in R that shifts elements of a vector to the opposite direction of what Lag() of the Hmisc package does? (something like, Lag(x, shift = -1) ) Thanks Zava -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
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
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 <-
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
2008 Jan 17
1
acf lag1 value
Hi R, I have doubt. >x= c(4,5,6,3,2,4,5) >acf(x,plot=F,lag.max=1) Autocorrelations of series 'x', by lag 0 1 1.000 0.182 But if I actually calculate the autocorrelation at lag1 I get, >cor(x[-1],x[-length(x)]) [1] 0.1921538 Even in excel I get 0.1921538 value. So, I want to know what the 'acf' function is calculating here....
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
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
2018 Mar 25
3
Take average of previous weeks
Dear all, I have weekly data by city (variable citycode). I would like to take the average of the previous two, three, four weeks (without the current week) of the variable called value. This is what I have tried to compute the average of the two previous weeks; df = df %>% mutate(value.lag1 = lag(value, n = 1)) %>% mutate(value .2.previous = rollapply(data = value.lag1,
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
2005 Aug 13
1
How to make a lagged variable in panel data?
Suppose we observe N individuals, for each of which we have a time-series. How do we correctly create a lagged value of the time-series variable? As an example, suppose I create: A <- data.frame(year=rep(c(1980:1984),3), person= factor(sort(rep(1:3,5))), wage=c(rnorm(15))) > A year person wage 1 1980 1 0.17923212 2 1981
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
1999 May 06
0
image weirdness
I am using R 63.0. Now let's try this simple image plot. Here is the data file: ============================ lag1 lag2 cif2d 1 1 11 1 2 12 1 3 13 2 1 21 2 2 22 2 3 23 3 1 31 3 2 32 3 3 33 ==================== data<-read.table("~/r/rt/data/unif/junk.out",header=TRUE) x<-unique(data$lag1) y<-unique(data$lag2) z<-matrix(data$cif2d,length(y),length(x)) At this point, see
2008 Jul 06
1
Different Autocorrelation using R and other softwares
Dear All, Would like to ask the inconsistency in the autocorrelation from R with SPSS/Minitab. I have tried a dataset x with 20 data (1-20) and ask R to give the autocorrelation of different lags using the command < acf(x, lag.max=100, type = "correlation"), However while SPSS and Minitab give the same answers (0.85 for lag1), R gives 0.3688 which is much smaller. Obviously, the
2013 Apr 30
0
Ridge regression
Hi all, I have run a ridge regression on a data set 'final' 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
1999 May 06
0
matrix weirdness
I am using R on unix version 63.0 I am doing an image plot of the following data file: ================================ lag1 lag2 cif2d 0.000 0.000 NaN 0.000 1.000 0.500000 0.000 2.000 0.489831 0.000 3.000 0.492986 0.000 4.000 0.493409 0.000 5.000 0.492727 0.000 6.000 0.494485 1.000 0.000 0.500000 1.000 1.000 NaN 1.000 2.000 0.495098 1.000 3.000 0.489831 1.000 4.000 0.492986 1.000 5.000