similar to: plot two time series with different length and different starting point in one figure.

Displaying 20 results from an estimated 2000 matches similar to: "plot two time series with different length and different starting point in one figure."

2013 Mar 21
4
easy way of paste
Hello, Is there a better way to use paste such as: a = paste(colnames(list.indep)[1],colnames(list.indep)[2],colnames(list.indep)[3],colnames(list.indep)[4],colnames(list.indep)[5],sep="+") > a [1] "aa+dummy1+dummy2+bb+cc" I tried a = paste(colnames(list.indep)[1:5],sep="+") > a [1] "aa" "dummy1" "dummy2"
2013 Mar 21
2
How to store data frames into pdf file and csv file.
Hello, I have a data frame > mdl.summary est.coef std.err t.stat intercept 0.0011625517 0.0002671437 4.351784 aa -0.0813727439 0.0163727943 -4.969997 dummy1 -0.0002534873 0.0001204000 -2.105376 dummy2 -0.0007784864 0.0001437537 -5.415417 bb -0.0002856727
2013 Mar 20
3
How to look at the source code for predict()
Hello, I try to look at the source code of predict() it turns out that I cannot find it. I can see it with debug(library), but not efficient. Can someone help? Thanks, Rebecca ---------------------------------------------------------------------- This message, and any attachments, is for the intended r...{{dropped:5}}
2013 Mar 22
4
error while extracting the p-value from adf.test
Hello all, I tried to extract the p-value from adf.test in tseries; however, I got the error message such as > ht=adf.test(list.var$aa) > ht$p-value Error in ht$p - value : non-numeric argument to binary operator > ht Augmented Dickey-Fuller Test data: list.var$aa Dickey-Fuller = -2.3147, Lag order = 4, p-value = 0.4461 alternative hypothesis: stationary > ht$data [1]
2013 Feb 01
2
Range difference of plot two arrays in one plot
Hello all, When I tried to plot the following two arrays in one figure with the following: x = c(0,0,0,10,20,30) y = c(40,50,60,70,80,90) plot(x, type='o', ylim=c(min(x),max(x))) par(new=T) plot(y, type='l', ylim=c(min(y),max(y))) Found that the first points and last points from those two arrays are overlapping together, but the value 30 is not equal to 90. How could I draw
2013 Jan 18
2
A smart way to use "$" in data frame
Hello all, I have a data frame dataa: newdate newstate newid newbalance newaccounts 1 31DEC2001 AR 1 1170 61 2 31DEC2001 VA 2 4565 54 3 31DEC2001 WA 3 2726 35 4 31DEC2001 AR 3 2700 35 The following gives me the balance of state AR:
2009 Jul 20
1
a complicated merging task
I would like to merge two dataframes, but i have a condition that needs to used for the merge as well. the rows (observations) in each dataframe are identified by each person's ID and by the date of the observation. Basically I would like it to be merged based on both ID (exact match) and date (a condition where one dataframe's date must be after the other dataframe's date).
2013 May 28
1
The weak exogeneity test in R for the Error Correction Model?
Hello all, I would like to carry out a single-equation approach of the Error Correction Model such as Delta_y(t) = a + b*y(t-1) + c*x1(t-1) + d*x2(t-1) + e*delta_x1(t) + f*delta_x2(t) + epsilon(t) Where, a, b, c, d, e, f are coefficients to be estimated, y is the dependent variable, and x1, x2 are independent variables. For the single equation approach of ECM, there is a requirement of the
2013 Mar 19
4
How to get the t-stat for arima()?
Hello all, fit = arima() and Summary(fit) will give some summary of the fit. However, the t-stats are not shown in the summary. How can I get the t-stats of it? Thanks, Rebecca ---------------------------------------------------------------------- This message, and any attachments, is for the intended r...{{dropped:5}}
2013 Jan 23
4
to check if a character string is in a group of character strings
Hello, How can I judge if a string is in a group of string? For example, I would like to have if (subpool in pool){ }else{ } Where > pool = c("s1","s2") > subpool = c("s1") How can I write the "subpool in pool" right in R? Thanks very much! Cheers, Rebecca ---------------------------------------------------------------------- This message,
2013 Jan 02
3
suggestions about import SAS results to R.
Hello all, I have got some data in SAS, and I export it to one excel workbook with multiple sheets, for example, each sheet has the sales information for each state. Then I need to use R to do plotting, analysis on those sales data, where I need to load the data from excel to R. When I read the article at this link: http://yihui.name/en/2009/09/how-to-import-ms-excel-data-into-r/ I am
2013 Apr 08
2
Can I open an existing pdf file and attach result to it?
Hello all, I would like to attach some results from R to an existing pdf file, can I do that through R? Thanks, Rebecca ---------------------------------------------------------------------- This message, and any attachments, is for the intended r...{{dropped:5}}
2013 Jan 30
1
fSeries not found in R
Hello all, When I tried to install fSeries in R, I got the following error messages: install.packages("fSeries",dependencies=T) Warning message: package 'fSeries' is not available (for R version 2.15.2) Is this package changing/merging to another package? Thanks, Rebecca ---------------------------------------------------------------------- This message, and any
2013 Jan 16
2
How to cut the time format short
Hello all, I have a time format looks like 31JAN2002:00:00:00.000 How could I cut it to 31JAN2002 ? I tried with format() but not work. Thanks, Rebecca ---------------------------------------------------------------------- This message, and any attachments, is for the intended r...{{dropped:5}}
2013 Mar 21
1
Could I get the following stats from arima()?
Hello all, I use the arima to get a model, i.e. fit = arima(x,order=c(1,0,0)) and I know I can get the following from fit via est.coef = coef(fig) est.aic = fit$aic std.err = sqrt(diag(vcov(fit))) t.stat = est.coef/std.err How can I get the following stat from arima? Pr(>|t|) r2 adjust_r2 rmse Thanks, Rebecca
2013 Sep 26
2
Sums based on values of other matrix
Dear all, I have a big problem: - I got two matrices, A and B - A shows identifies the value of B, however the values of B must be summed - For instance, 1 1 2 2 2 2 1 1 gives matrix a 3 4 2 1 1 1 2 2 gives matrix b Now the result for the value 1 would be 7 4 which are the rowsums of the values of matrix B given that matrix A has the value 1. How can I do this automatically? I
2013 Feb 20
1
To convert a quarterly data to a monthly data.
Hello, I have a data set has 2001Q1 100 2001Q2 101 2001Q3 120 2001Q4 103 ... And would like to convert it to a monthly data. i.e. 200101 XXX 200102 XXX 200103 XXX
2010 Nov 15
3
How to plot effect of x1 while controlling for x2
Hello R-helpers, Please see a self-contained example below, in which I attempt to plot the effect of x1 on y, while controlling for x2. Is there a function that does the same thing, without having to specify that x2 should be held at its mean value? It works fine for this simple example, but might be cumbersome if the model was more complex (e.g., lots of x variables, and/or interactions). Many
2007 Oct 01
4
Disentagling formulas
I am writing a program in which I would like to take in a formula, change the response (Y) variable into something else, and then pass the formula, with the new Y variable to another function. That is, I am starting with formula <- Y~X1+X2+X3 and I'd like to do something like Y <- formula$Y newY <- f(Y) lm(newY~X1+X2+X3) So far, it seems that my
2007 Jul 20
6
automatically jpeg output
Dear R users, I used R to draw many histograms and I would like to automatically save them into a jpeg file. I tried the following code since I know .ps file could be saved like this way: postscript("AYA_ELA.jpeg",horizontal=F,onefile=T) ......#some funtions inside here dev.off() There was a jpeg file, however, there is no pictures inside. Any suggestion? Thanks. Rebecca