[R] Announcement: CRAN packages 'urca' and 'vars' on R-Forge
Dear useR, the CRAN packages 'urca' and 'vars' are now hosted on R-Forge as projects 'AICTS I' and 'AICTS II', respectively. The packages' summary page can be directly accessed via: AICTS I: http://r-forge.r-project.org/projects/urca/ AICTS II: http://r-forge.r-project.org/projects/vars/ All R-Forge features for both projects have been enabled. For more information about R-Forge, visit: http://r-forge.r-project.org/ Best, Bernhard * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] possible bug in vars package (predict.varest) ???
Hello Spencer, which version of vars are you using? This has been fixed a while ago (see ChangeLog). Incidentally, the data in Canada is quarterly data, as stated in ?Canada. Aside of this, your code snippet works fine. Best, Bernhard ps: There is no need to download the tarball as suggested by Mark, instead you can do: vars:::predict.varest hello, I have been trying to use the predict function in the vars package to forecast from a seasonal VAR model. The following code sample illustrates what I am trying to do and the error that I get when trying to do it. I run the following code, that results in the following error: data(Canada) endoC - Canada[1:72,1:3] exoC - Canada[1:72,4] var.2c - VAR(endoC, p = 2, season=12,exogen=exoC,type = const) exoC_2 - as.matrix(Canada[73:84,4]) predict(var.2c, n.ahead = 12,dumvar=exoC_2) Error: Error in as.matrix(cycle, nrow = season, ncol = season - 1) : unused argument(s) (nrow = 12, ncol = 11) from what I can guess, the predict.varest function is using as.matrix() and passing nrow and ncol, as.matrix() does not take those two parameters but matrix() does. Does anyone have a suggestion of how to get around it? Is there a way I can get to the predict.varest() function and alter it myself? Thanks, Spencer [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Restricted VAR parameter estimation
Hello Megh, in principle you can do OLS on an equation-per-equation basis. However, in this case the estimator might be asymptotically inefficient. One can use FGLS instead. This is outlined for instance in: Helmut Luetkepohl, 2007. Econometric Analysis with Vector Autoregressive Models, Economics Working Papers ECO2007/11, European University Institute. http://cadmus.iue.it/dspace/bitstream/1814/6918/1/ECO-2007-11.pdf Incidentally, you can also use restrict() [OLS-based] in package vars; version 1.3-1 has been uploaded to /incoming on CRAN and it should appear on the mirrors soon. Best, Bernhard I have a VAR model with five macro-economic variables, y[1], y[2], y[3], y[4], y[5]. They are related to each other in following manner. y[1,t] = alpha[1,0] + beta[1,1, 1]*y[1,t-1]++beta[1,1, 12]*y[1,t-12] + beta[1,2, 1]*y[2,t-1]++beta[1,2, 12]*y[2,t-12] + e[1,t] y[2,t] = alpha[2,0] + beta[2,2, 1]*y[2,t-1]++beta[2,2, 12]*y[2,t-12] + e[2,t] y[3,t] = alpha[3,0] + beta[3,1, 1]*y[1,t-1]++beta[3,1, 12]*y[1,t-12] + beta[3,2, 1]*y[2,t-1]++beta[3,2, 12]*y[2,t-12] + beta[3,3, 1]*y[3,t-1]++beta[3,3, 12]*y[3,t-12] + beta[3,4, 1]*y[4,t-1]++beta[3,4, 12]*y[4,t-12] + e[3,t] y[4,t] = alpha[4,0] + beta[4,3, 1]*y[3,t-1]++beta[4,3, 12]*y[3,t-12] + beta[4,4, 1]*y[4,t-1]++beta[4,4, 12]*y[4,t-12] + e[4,t] y[5,t] = alpha[5,0] + beta[5,3, 1]*y[3,t-1]++beta[5,3, 12]*y[3,t-12] + beta[5,5, 1]*y[5,t-1]++beta[5,5, 12]*y[4,t-12] + e[5,t] All variables are stationary Now I want to estimate the coefficients under a VAR[12] framework. Is it mathematically correct to estimate coefficients of each equaltion with simple OLS separately? Or how I can use R [mAr.est() function) to estimate them? Regards, - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Seasonality
Hello Alberto, hello Felix, aside of monthplot() and stl(), there is the possibility to use Census X-12-ARIMA. The program can be downloaded from: http://www.census.gov/srd/www/x12a/ It should be mentioned that this is *not* a pure R solution, but one can set up the relevant scripts and output files and call the program from R and read in the relevant numbers back into R again. Best, Bernhard ?monthplot ?stl On 8/10/07, Alberto Monteiro [EMAIL PROTECTED] wrote: I have a time series x = f(t), where t is taken for each month. What is the best function to detect if _x_ has a seasonal variation? If there is such seasonal effect, what is the best function to estimate it? Function arima has a seasonal parameter, but I guess this is too complex to be useful. Alberto Monteiro __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Felix Andrews / 安福立 PhD candidate Integrated Catchment Assessment and Management Centre The Fenner School of Environment and Society The Australian National University (Building 48A), ACT 0200 Beijing Bag, Locked Bag 40, Kingston ACT 2604 http://www.neurofractal.org/felix/ voice:+86_1051404394 (in China) mobile:+86_13522529265 (in China) mobile:+61_410400963 (in Australia) xmpp:[EMAIL PROTECTED] 3358 543D AAC6 22C2 D336 80D9 360B 72DD 3E4C F5D8 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] cointegration analysis
Hello Dorina, if you apply ca.jo to a system with more than five variables, a *warning* is issued that no critical values are provided. This is not an error, but documented in ?ca.jo. In the seminal paper of Johansen, only cv for up to five variables are provided. Hence, you need to refer to a different source of cv in order to determine the cointegration rank. Best, Bernhard Hello, I tried to use urca package (R) for cointegration analysis. The data matrix to be investigated for cointegration contains 8 columns (variables). Both procedures, Phillips Ouliaris test and Johansen's procedures give errors (error in evaluating the argument 'object' in selecting a method for function 'summary' respectiv too many variables, critical values cannot be computed). What can I do? With regards, Dorina LAZAR Department of Statistics, Forecasting, Mathematics Babes Bolyai University, Faculty of Economic Science Teodor Mihali 58-60, 400591 Cluj-Napoca, Romania __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] ca.jo
Hello Yihsu, have a look at ?cajorls. With this function a VECM is estimated, whence the cointegration rank has been determined (ca.jo). For further analysis, you might want to consider the function vec2var in package vars and methods irf, fevd and predict, as well as the diagnostic tests that are available in vars. Best, Bernhard Dear R users; I'm using ca.jo for a VECM model. Is there a way that I can get sd/p-value to see whether coefficients estimated are statistical significant? Thank you Yours, Yihsu [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Combine graphical and textual output
Hello Dieter, aside of Petr's suggestion, you might want to look at the 'relax' package. Here, you can produce html as well as tex for on-the-fly reports. The reports are set up within a tcl/tk window. Best, Bernhard Hi, I would like to know whether anybody knows a simple way to combine textual and graphical output in R. A typical analysis produces textual output (e.g. model fits) and plots in R. I would like to know whether R has the possibility of combining these into a single 'report' or output. An example of a program that does this is SPSS. After running the analysis you have a combination of textual output (tables) and plots that are easy to print and distribute. I know of the possibility to embed R code into LATEX (using Sweave), but I wouldn't call this quick since a lot of coding will go into writing the Sweave file. Any other suggestions? Regards, Dieter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] urca package - summary method -
Hi I am using the package urca and I am interested about the KPSS test. That works fine except the method summary did not work in the script, only when it is typed direct in the console the results are shown( not a source file). Hello, which version of urca are using? The problem you mentioned has been fixed in November last last year (see R-Help, there is an extensive thread about the explicit loading of methods as well as the Changelog of urca: 2006-11-04 Dr. Bernhard Pfaff [EMAIL PROTECTED] * NAMESPACE: import(methods) inserted ). I have checked again with: file kpsstest.R library(urca) data(nporg) gnp - na.omit(nporg[, gnp.r]) gnp.l - log(gnp) kpss.gnp - ur.kpss(gnp.l, type=tau, lags=short) summary(kpss.gnp) summary(ur.kpss(gnp.l, type=tau, lags=short)) end file and R CMD BATCH --no-restore kpsstest.R which runs flawlessly. Hence, a simple update of 'urca' should solve your problem. Best, Bernhard Is there any problem with these method ? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] lag orders with ADF.test
Hello! I do not understand what is meant by: aic and bic follow a top-down strategy based on the Akaike's and Schwarz's information criteria in the datails to the ADF.test function. What does a top-down strategy mean? Probably the respective criterion is minimized Hello Martin, are you referring to ADF.test() in package uroot? If so, it would be good to adress this question to the package maintainer first, which I have cc'ed. Different approaches for determining an appropriate lag length for ADF tests are propagated in the literature. One of them is the usage of information criteria; a second one starting from a high lag number and cutting the lag length down by signifcance (top to bottom) or vice versa (bottom to top); or finally inspect the ACF/PACF's of the residuals in the ADF-test regression and choose the lowest possible lag length such that the residuals are uncorrelated. Best, Bernhard and the mode vector contains the lag orders at which the criterion attains it local minima? When the calculation is over, the ADF.test function gives info about Lag orders. What are these lag orders? Are they the local minima of the criterion? I will be very thankful if you clarify this to me. I browsed a lot, but I could not find a clear answer. Thank you for your attention. Regards, Martin - http://auto-motor-und-sport.bg/ С бензин в кръвта! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] time series analysis
Hello John, as a starting point you might also want to have a look at: @book{BOOK, author={Robert S Pindyck and Daniel L Rubinfeld}, title={Econometric Models and Economic Forecasts}, year={1997}, publisher={McGraw-Hill/Irwin}, isbn={0079132928} } The monographies of Hamilton and Lütkepohl might then be taken into focus. Best, Bernhard John -- Well, as a start, have a look at Modern Applied Statistics with S, by Venables and Ripley, both of which names you will recognize if you read this list often. There is a 30-page chapter on time series (with suggestions for other readings), obviously geared to S and R, that is a good jumping-off place. Ben Fairbank -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of lamack lamack Sent: Thursday, February 01, 2007 3:12 PM To: R-help@stat.math.ethz.ch Subject: [R] time series analysis Does anyone know a good introductory book or tutorial about time series analysis? (time series for a beginner). Thank you so much. John Lamak _ Descubra como mandar Torpedos SMS do seu Messenger para o celular dos seus amigos. http://mobile.msn.com/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Finding the Min.
?which.min Dear all R users, Suppose I have a dataset like that, data = 1 1.957759e-09 2 1.963619e-09 3 1.962807e-09 4 1.973951e-09 5 1.983401e-09 6 1.990894e-09 7 2.000935e-09 8 1.998391e-09 9 1.973322e-09 10 1.983202e-09 I want to see at which row minimum value of the second column occures. Therefore I made the following loop: i=1 while (min(data[,2]) != data[i,2]) { i = i+1 } i [1] 1 Is there any more effective way to do that in terms of time consumption? Thanks stat - Here's a new way to find what you're looking for - Yahoo! Answers [[alternative HTML version deleted]] * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] problem in adf command
that is, equation with constant and trend is used.if i did not include constant or trend in the equation and run the command then how i can run this command in tseries. Dear Zahid, you can employ ur.df() in package 'urca' or the wrapped functions from 'urca' contained in package 'fSeries', see ?ur.df and ?UnitrootTests for more information, respectively. Best, Bernhard * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] problem in adf command
ur.df(y, type = c(none, drift, trend), lags = 1) in urca. this gives me all out put .but i need only p.value fromm the output. when i run the following command ur.df(y, type = c(none, drift, trend), lags = 1)$p.value this in response null.kindly help me in this regard. thanks With Best Regards Hello Zahid, you do not need to send your message three times to the list. As the package's documentation outlines: 'urca' utilises formal classes (i.e. S4). Hence, to obtain slots, you should use '@' and not '$'. Anyway, who is telling you, that p.value is a slot of a returned ur.df object? At least not ?ur.df. Now, if you take a look at ?UnitrootTests in package 'fSeries' you will read that these test implementation do contain p.values, hence: library(urca) library(fSeries) ## to generate some data use the example example(UnitrootTests) test.adf - adfTest(y, type = 'c') slotNames(test.adf) names([EMAIL PROTECTED]) [EMAIL PROTECTED] Best, Bernhard * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Error message using normality test in vars
I'm running a vector-time series model with the vars package. When I test the univariate and multivariate normality of the residuals using normality(), I get the results, but also this warning Warning messages: 1: longer object length is not a multiple of shorter object length in: b2 - rep(3, 4) 2: longer object length is not a multiple of shorter object length in: b2 - rep(3, 4) What does this mean and do I need to worry about it. Dear David, thanks for pointing this out. The warning is caused in the calculation of the kurtosis in function .jb.multi which is contained in R/internal.R. The relevant expression should be 'rep(3, K)'. An updated version of package 'vars' will be submitted in due course. I will ship you version of the corrected package off list. Best, Bernhard * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] solution to a regression with multiple independent variable
Hello John, you can derive these estimators by considering a step-wise approach: 1) Derive the estimators by evaluating a model with demeaned variables, i.e. consider (\tilde{X}'\tilde{x})^-1 \tilde{x}'\tilde{y}, where \tilde{...} refers to the demeaned variables. 2) Obtain the estimate of the intercept, by utilising the Schwerpunkteigenschaft of the OLS estimator. HTH, Bernhard Please forgive a statistics question. I know that a simple bivariate linear regression, y=f(x) or in R parlance lm(y~x) can be solved using the variance-covariance matrix: beta(x)=covariance(x,y)/variance(x). I also know that a linear regression with multiple independent variables, for example y=f(x,z) can also be solved using the variance-covariance matrix, but I don't know how to do this. Can someone help me go from the variance-covariance matrix to the solution of a regression with multiple independent variables? It is not clear how one applies the matrix solution b= (x'x)-1*x'y to the elements of the variance-covariance matrix, i.e. how one gets the required values from the variance-covariance matrix. Any help, or suggestions would be appreciated. Thanks, John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Multivariate regression
Hello Ravi, have you considered the SUR method proposed by Zellner? An implementation of it is provided in CRAN-package 'systemfit' (see ?systemfit for more information). Best, Bernhard Suppose I have a multivariate response Y (n x k) obtained at a set of predictors X (n x p). I would like to perform a linear regression taking into consideration the covariance structure of Y within each unit - this would be represented by a specified matrix V (k x k), assumed to be the same across units. How do I use lm to do this? One approach that I was thinking of is as follows: Flatten Y to a vector, say, Yvec (n*k x 1). Create Xvec (n*k, p*k) such that it is made up of block matrices Bij (k x k), where Bij is a diagonal matrix with X_ij as the diagonal (i = 1,.n, and j = 1,.,p). Now I can use lm in a univariate mode to regress Yvec against Xvec, with covariance matrix Vvec (n*k x n*k). Vvec is a block-diagonal matrix with blocks of V along the diagonal. This seems like a valid approach, but I still don't know how to specify the covariance structure to do weighted least squares. Any help is appreciated. Best, Ravi. --- - --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email: [EMAIL PROTECTED] Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html --- - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] .arch.uni in function call in arch test of vars package
The arch test requires a varest object and I am trying to write one that will use R-metrics arima, arch, Garch objects, or at least a vector. Also the arch function has the following line of code that I can not find the function anywhere archs.resids - apply(resids, 2, function(x) .arch.uni(x, lags.single = lags.single)) Hello Joe, have a look at the source code (internal.R). For your convenience the function is: ## univariate ARCH test .arch.uni - function(x, lags.single){ lags.single - lags.single + 1 mat - embed(scale(x)^2, lags.single) arch.lm - summary(lm(mat[, 1] ~ mat[, -1])) STATISTIC - arch.lm$r.squared*length(resid(arch.lm)) names(STATISTIC) - Chi^2 PARAMETER - lags.single - 1 names(PARAMETER) - df PVAL - 1 - pchisq(STATISTIC, df = PARAMETER) METHOD - ARCH test (univariate) result - list(statistic = STATISTIC, parameter = PARAMETER, p.value = PVAL, method = METHOD, data.name = deparse(substitute(x))) class(result) - htest return(result) } Best, Bernhard does any one know about the function .arch.uni? Thank you Joe __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Multivariate AR - prediction
Hello Alexander, try package CRAN package 'vars'. Best, Bernhard Hi, does anybody know how to predict a multivariate AR within R? If I just estimate a multi AR-object and plug it into predict I get an error from the aperm - just works for univariates. thx alex __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Omegahat-site down?
Dear R-list subscriber, is it possible that the omegahat-site is down? I was looking for package 'RDCOMClient', but could not establish a connection. In case somebody has the latest binary zip-file for Windows, would she/he mind to send it directly to my emaim adress stated in the signature? Many thanks, and sorry for bothering/misusing R-help in this instance. Best, Bernhard Dr. Bernhard Pfaff Global Structured Products Group (Europe) Invesco Asset Management Deutschland GmbH Bleichstrasse 60-62 D-60313 Frankfurt am Main Tel: +49(0)69 29807 230 Fax: +49(0)69 29807 178 Email: [EMAIL PROTECTED] * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] CRAN package: update of 'vars' submitted
Dear useR! an updated version of package 'vars' has been shipped to CRAN lately. Information on package 'vars': == Title: VAR Modelling Version: 0.1.3 Date: 2006-07-27 Author:Bernhard Pfaff Maintainer:Bernhard Pfaff bernhard at pfaffikus.de Depends: R (= 2.0.0), MASS, strucchange Saveimage: yes Description: Estimation, lag selection, diagnsotic testing, forecasting, causality analysis, forecast error variance decomposition and impulse response functions of VAR models and estimation of SVAR models (A-model, B-model, AB-model). License: GPL 2 or newer URL: http://www.pfaffikus.de The package is shipped with a NAMESPACE and S3-classes/methods have been employed. It should be noted, that this package is still in its infancy, and more features and functionalities are in the pipeline. Hence, I would appreciate your feedback -- off list, adressed to the email adress in the DESCRIPTION file. Best, Bernhard Dr. Bernhard Pfaff Global Structured Products Group (Europe) Invesco Asset Management Deutschland GmbH Bleichstrasse 60-62 D-60313 Frankfurt am Main Tel: +49(0)69 29807 230 Fax: +49(0)69 29807 178 Email: bernhard_pfaff at fra.invesco.com * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] KPSS test
Hello Sachin, a sequential testing procedure is described in the useR! book: @Book{, title = {Analysis of Integrated and Cointegrated Time Series with R}, author = {B. Pfaff}, publisher = {Springer}, edition = {First}, address = {New York}, year = {2006}, note = {ISBN 0-387-27960-1}, } Best, Bernhard Dr. Bernhard Pfaff Global Structured Products Group (Europe) Invesco Asset Management Deutschland GmbH Bleichstrasse 60-62 D-60313 Frankfurt am Main Tel: +49(0)69 29807 230 Fax: +49(0)69 29807 178 Email: [EMAIL PROTECTED] -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Sachin J Gesendet: Donnerstag, 6. Juli 2006 21:49 An: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Betreff: Re: [R] KPSS test Hi Mark, Thanx for the help. I will verify my results with PP and DF test. Also as suggested I will take a look at the references pointed out. One small doubt: How do I decide what terms ( trend, constant, seasonality ) to include while using these stationarity tests. Any references would be of great help. Thanx, Sachin [EMAIL PROTECTED] wrote: From: Date: Thu Jul 06 14:17:25 CDT 2006 To: Sachin J Subject: Re: [R] KPSS test sachin : i think your interpretations are right given the data but kpss is quite a different test than the usual tests because it assumes that the null is stationarity while dickey fuller ( DF ) and phillips perron ( PP ) ) assume that the null is a unit root. therefore, you should check whetheer the conclusions you get from kpss are consistent with what you would get from DF or PP. the results often are not consistent. also, DF depends on what terms ( trend, constant ) you used in your estimation of the model. i'm not sure if kpss does also. people generally report Dickey fuller results but they are a little biased towards acepting unit root ( lower power ) so maybe that's why you are using KPSS ? Eric Zivot has a nice explanation of a lot of the of the stationarity tests in his S+Finmetrics book. testing for cyclical variation is pretty complex because that's basically the same as testing for seasonality. check ord's or ender's book for relatively simple ways of doing that. From: Sachin J Date: Thu Jul 06 14:17:25 CDT 2006 To: R-help@stat.math.ethz.ch Subject: [R] KPSS test Hi, Am I interpreting the results properly? Are my conclusions correct? KPSS.test(df) KPSS test Null hypotheses: Level stationarity and stationarity around a linear trend. Alternative hypothesis: Unit root. Statistic for the null hypothesis of level stationarity: 1.089 Critical values: 0.10 0.05 0.025 0.01 0.347 0.463 0.574 0.739 Statistic for the null hypothesis of trend stationarity: 0.13 Critical values: 0.10 0.05 0.025 0.01 0.119 0.146 0.176 0.216 Lag truncation parameter: 1 CONCLUSION: Reject Ho at 0.05 sig level - Level Stationary Fail to reject Ho at 0.05 sig level - Trend Stationary kpss.test(df,null = c(Trend)) KPSS Test for Trend Stationarity data: tsdata[, 6] KPSS Trend = 0.1298, Truncation lag parameter = 1, p-value = 0.07999 CONCLUSION: Fail to reject Ho - Trend Stationary as p-value sig. level (0.05) kpss.test(df,null = c(Level)) KPSS Test for Level Stationarity data: tsdata[, 6] KPSS Level = 1.0891, Truncation lag parameter = 1, p-value = 0.01 Warning message: p-value smaller than printed p-value in: kpss.test(tsdata[, 6], null = c(Level)) CONCLUSION: Reject Ho - Level Stationary as p-value sig. level (0.05) Following is my data set structure(c(11.08, 7.08, 7.08, 6.08, 6.08, 6.08, 23.08, 32.08, 8.08, 11.08, 6.08, 13.08, 13.83, 16.83, 19.83, 8.83, 20.83, 17.83, 9.83, 20.83, 10.83, 12.83, 15.83, 11.83), .Tsp = c(2004, 2005.917, 12), class = ts) Also how do I test this time series for cyclical varitions? Thanks in advance. Sachin - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Cointegration Test in R
Hello Dennis, have you considered the function bh6lrtest() in the package urca? To my knowledge, there is no other package available that offers VECM functionalities. Best, Bernhard ps: As you migth be interested in VAR and SVAR too: I am currently working on such a package which should be submitted to CRAN after summer. Dr. Bernhard Pfaff Global Structured Products Group (Europe) Invesco Asset Management Deutschland GmbH Bleichstrasse 60-62 D-60313 Frankfurt am Main Tel: +49(0)69 29807 230 Fax: +49(0)69 29807 178 Email: [EMAIL PROTECTED] -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Dennis Heidemann Gesendet: Donnerstag, 29. Juni 2006 21:20 An: R-help@stat.math.ethz.ch Betreff: [R] Cointegration Test in R Hello! I'm using the blrtest() function in the urca package to test cointegration relationships. Unfortunately, the hypothesis (restrictions on beta) specifies the same restriction on all cointegration vectors. Is there any possibility to specify different restrictions on the cointegration vectors? Are there any other packages in R using cointegration tests? Thanks and best regards. Dennis Heidemann [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] extract p-value from urppTest
Hello Anne, the function 'ur.pp' contained in the package 'urca' has been ported into the package 'fSeries' (see the documentaion of ?urppTest). help(ur.pp-class, package=urca) will tell you that p-values are not part of this class, i.e., these are not computed but critical values are returned. Now, inside of the function 'urppTest', 'ur.pp' is called and an object of class 'fHTEST' is returned (you can see this, by simply typing 'urppTest'). The class 'fHTEST' does contain the slot 'test' (it is a list). You can see this by spotting at getClass(fHTEST). However, what is stored into test is the outcome of 'show(your ur.pp-object)', i.e. the print-out of the test statistic. In contrast, by typing 'adfTest' you will easily see, that the p-values are calculated within this function and are part of the slot 'test'. Best, Bernhard Dear List, How do I pick the p-value out of the urppTest result? For adfTest the p-value can be extracted by [EMAIL PROTECTED] following A2 - adfTest(myData[,i], lags=2, type=c(c)) What do I do for urppTest? The above doesn't seem to work. There is a slot @test with $output, which is a list of various test results that didn't want to give away only the p-value (I'm fairly new to R, so this might well be my fault). I thought I had found a way around this by # dissolve testresult into lines listasvectors - unlist([EMAIL PROTECTED]) # pick the line containing p-value getpvalue - unlist(strsplit(listasvectors[17], )) # isolate the p-value (number only) getpvalue[14] However, I'm doing this in a loop and it seems for each test result there is a different number of entries or seperators . For example, sometimes ends up being displayed as the p-value. I'd be very happy about any help on how to extract the p-value. Thanks, Katrin __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] urppTest Z-tau? Z-alpha?
Hello Anne, you will find the necessary details in the following paper, its publication in 'Biometrika' is cited in ?ur.pp. http://cowles.econ.yale.edu/P/cp/p07a/p0706.pdf Best, Bernhard Hello, Could someone give me a hint about what might be the difference between running urppTest with Z-alpha and Z-tau in type=c(Z-alpha, Z-tau)? Is this the underlying equation: delta_y(t) = mu + tau*timetrend+(1-rho)*y(t-1) + alpha_1*delta_y(t-1) + ... + alpha_k*delta_y(t-k) + error term ? I looked at Banerjee et al. mentioned in the fSeries documentation, but that didn't help. Thanks a lot, Katrin __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Net courses for R?
Hello Scott, see: http://www.statistics.com/content/courses/R/index.html http://www.statistics.com/content/courses/graphicsR/index.html http://www.statistics.com/content/courses/modelingR/index.html there has been a recent posting on this list, if I recall it correctly. Best, B. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Scott Cunningham Gesendet: Mittwoch, 3. Mai 2006 16:34 An: r-help@stat.math.ethz.ch Betreff: [R] Net courses for R? Are there any online courses for learning R? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Link to useR! 2006 from ww.r-project.org not working
I noticed that: http://www.r-project.org/useR-2006/ seems to be inexistent (page not found). Best, Bernhard Dr. Bernhard Pfaff Global Structured Products Group (Europe) Invesco Asset Management Deutschland GmbH Bleichstrasse 60-62 D-60313 Frankfurt am Main Tel: +49(0)69 298 07230 Fax: +49(0)69 298 07178 Email: [EMAIL PROTECTED] * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] What are the differences between ACF and PACF in time seriesanalysis?
Hello Michael, see as an online resource: http://www.statsoft.com/textbook/sttimser.html or get hold on a time series analysis textbook, like one of the monographies written by Hamilton; Luetkepohl; Brockwell Davis; Harvey or Box Jenkins, to name but a few. In a nutshell, PACF 'eliminates' intermediate autocorrelations compared to ACF, e.g. an AR(1) process will ordinarily have a slowly decaying ACF and a single spike in the PACF at lag 1. Both are utilised in the process of order determination in the context of the Box-Jenkins approach for time series modelling. Best, Bernhard Hi all, I am desperately looking for answer to my previous question: what are the differences between ACF and PACF in time series and their applications? I got confused a lot by these two functions in R... Already having ACF, why do people decide to create PACF? Thanks a lot [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Is there a way....
Hello Levent, there has recently been a thread on the ESS list by using setnu in EMACS: https://stat.ethz.ch/pipermail/ess-help/2006-April/003450.html Bernhard -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Uwe Ligges Gesendet: Mittwoch, 26. April 2006 13:38 An: Levent TERLEMEZ Cc: r-help@stat.math.ethz.ch Betreff: Re: [R] Is there a way Levent TERLEMEZ wrote: Hello, I would like to get rid of counting lines in fix() when i made a mistake in coding? Is there an easy way to an line numbers to editor? I think the feature you are requesting is not available. Beside, it is a good idea to use some appropriate editor and source() your function rather than using the fix() function. Uwe Ligges Thanks. Levent TERLEMEZ. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Bloomberg Data Import to R
Hello Sumanto, your question might be more appropriately been posted to the R-sig-finance list: [EMAIL PROTECTED] (I have cc'ed this mail to this list). To my knowledge neither a function nor a CRAN-package does exist. However, on the last useR! conference Dirk Edelbuettel presented a proprietary package that utilised the C API of Bloomberg (type WAPI GO on a Bloomberg terminal). I am not sure whether Dirk is nowadays inclined or allowed by his employee to share this package. As an alternative, you could download data from Bloomberg into Excel, first (assuming that you are working in a Windows environment) and then load it into R via RODBC, for example. Cheers, Bernhard Hi R-Experts, Can anyone tell me how Bloomberg data can be directly downloaded to R? Is there any package? Sumanta Basak. --- This e-mail may contain confidential and/or privileged infor...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] reducing learning curves?
Hello Michael, you might want to utilise Emacs/ESS. ESS provides auto-completion by using TAB for a process buffer '*R*' and C-cTAB for a source file '*.R' (ess-mode). As far as debugging is concerned, R offers: ?browser ?debug ?trace for example. Additionally, there is a CRAN package named 'debug' available and an article in RNews: Mark Bravington. Debugging without (too many) tears. R News, 3(3):29-32, December 2003, about it. HTH, Bernhard -Ursprüngliche Nachricht- Von: Michael [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 25. Januar 2006 09:10 An: R-help@stat.math.ethz.ch Betreff: [R] reducing learning curves? Hi all, I am really new to the R language. I am a long time Matlab and C++ user and I was forced to learn R because I am taking a statistics class. I am seeking to reduce the learning curve to as smooth as possible. Are there any addon/plug-in features that can reduce the learning curve, for example, the following features can be very helpful for new learners: 1. Matlab-like command line auto-completion: Matlab has huge amount of command and nobody is able to remember them off the head. So a nice feature of Matlab command line is that I just need to type the first a few letters and then I press TAB key, there will be a list of possible commands popping up so I just need to select one. This helps a lot in terms of learning for new comers. A more advanced command auto-completion is Visual C++-like, which is implemented in program editor. It helps a lot while doing programming; 2. A good IDE editor with embedded inline debugger: can be as good as VC++, but also can be as simple as Matlab's debugger, which can breakpoint and trace line-by-line... the editor can do syntax correction, syntax check, syntax highlighting, code formatting, etc. Could you please recommend some good addon/plugins that have the above features? Could you please also suggest some tips/tools/tricks that can help me reduce the learning curve? Thank you very much! Michael. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R vs. Excel (R-squared)
Hello Lance, this was discussed on the list lately, see: http://tolstoy.newcastle.edu.au/~rking/R/help/06/01/18934.html Bernhard -Ursprüngliche Nachricht- Von: Lance Westerhoff [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 24. Januar 2006 17:51 An: r-help@stat.math.ethz.ch Betreff: [R] R vs. Excel (R-squared) Hello All- I found an inconsistency between the R-squared reported in Excel vs. that in R, and I am wondering which (if any) may be correct and if this is a known issue. While it certainly wouldn't surprise me if Excel is just flat out wrong, I just want to make sure since the R- squared reported in R seems surprisingly high. Please let me know if this is the wrong list. Thanks! To begin, I have a set of data points in which the y is the experimental number and x is the predicted value. The Excel- generated graph (complete with R^2 and trend line) is provided at this link if you want to take a look: http://www.quantumbioinc.com/downloads/public/excel.png As you can see, the R-squared that is reported by Excel is -0.1005. Now when I bring the same data into R, I get an R-square of +0.9331 (see below). Being that I am new to R and semi-new to stats, is there a difference between multiple R-squared and R-squared that perhaps I am simply interpreting this wrong, or is this a known inconsistency between the two applications? If so, which is correct? Any insight would be greatly appreciated! == # note: a is experimental and c is predicted summary(lm(a~c-1)) Call: lm(formula = a ~ c - 1) Residuals: Min 1Q Median 3Q Max -2987.6 -1126.6 -181.7 855.3 5602.8 Coefficients: Estimate Std. Error t value Pr(|t|) c 0.90.01402 71.33 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1423 on 365 degrees of freedom Multiple R-Squared: 0.9331, Adjusted R-squared: 0.9329 F-statistic: 5088 on 1 and 365 DF, p-value: 2.2e-16 version _ platform powerpc-apple-darwin7.9.0 arch powerpc os darwin7.9.0 system powerpc, darwin7.9.0 status major2 minor2.1 year 2005 month12 day 20 svn rev 36812 language R == Thank you very much for your time! -Lance Lance M. Westerhoff, Ph.D. General Manager QuantumBio Inc. WWW:http://www.quantumbioinc.com Email:[EMAIL PROTECTED] Safety is not the most important thing. I know this sounds like heresy, but it is a truth that must be embraced in order to do exploration. The most important thing is to actually go. ~ James Cameron __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Obtaining the adjusted r-square given the regression coef ficients
Hello Alexandra, R2 is only defined for regressions with intercept. See a decent econometrics textbook for its derivation. HTH, Bernhard -Ursprüngliche Nachricht- Von: Alexandra R. M. de Almeida [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 11. Januar 2006 03:48 An: r-help@stat.math.ethz.ch Betreff: [R] Obtaining the adjusted r-square given the regression coefficients Dear list I want to obtain the adjusted r-square given a set of coefficients (without the intercept), and I don't know if there is a function that does it. Exist I know that if you make a linear regression, you enter the dataset and have in summary the adjusted r-square. But this is calculated using the coefficients that R obtained,and I want other coefficients that i calculated separately and differently (without the intercept term too). I have made a function based in the equations of the book Linear Regression Analisys (Wiley Series in probability and mathematical statistics), but it doesn't return values between 0 and 1. What is wrong The functions is given by: adjustedR2-function(Y,X,saM) { if(is.matrix(Y)==F) (Y-as.matrix(Y)) if(is.matrix(X)==F) (X-as.matrix(X)) if(is.matrix(saM)==F) (saM-as.matrix(saM)) RX-rent.matrix(X,1)$Rentabilidade.tipo RY-rent.matrix(Y,1)$Rentabilidade.tipo r2m-matrix(0,nrow=ncol(Y),ncol=1) RSS-matrix(0,ncol=ncol(Y),nrow=1) SYY-matrix(0,ncol=ncol(Y),nrow=1) for (i in 1:ncol(RY)) { RSS[,i]-(t(RY[,i])%*%RY[,i])-(saM[i,]%*%(t(RX)%*%RX)%*%t(saM)[,i]) SYY[,i]-sum((RY[,i]-mean(RY[,i]))^2) r2m[i,]-1-(RSS[,i]/SYY[,i])*((nrow(RY))/(nrow(RY)-ncol(saM)-1)) } dimnames(r2m)-list(colnames(Y),c(Adjusted R-square)) return(r2m) } Thanks! Alexandra Alexandra R. Mendes de Almeida - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Q about RSQLite
Hello Liu, this might be caused by NA entries in your SQLite table. Have a look at the following code: (test - data.frame(matrix(c(1:10, NA, NA), ncol=2, nrow=6))) con - dbConnect(SQLite(), dbname = test.db) dbWriteTable(con, test, test, type=BLOB, overwrite=TRUE) d1 - dbReadTable(con, test) dbDisconnect(con) d1 HTH, Bernhard -Ursprüngliche Nachricht- Von: Wensui Liu [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 31. Dezember 2005 07:09 An: r-help@stat.math.ethz.ch Betreff: [R] Q about RSQLite Happy new year, dear listers, I have a question about Rsqlite. when I fetch the data out of sqlite database, there is something like '\r\n' at the end of last column. Here is the example: Sepal_Length Sepal_Width Petal_Length Petal_WidthSpecies 1 5.1 3.5 1.4 0.2 setosa\r\n 2 4.9 3.0 1.4 0.2 setosa\r\n 3 4.7 3.2 1.3 0.2 setosa\r\n 4 4.6 3.1 1.5 0.2 setosa\r\n 5 5.0 3.6 1.4 0.2 setosa\r\n 6 5.4 3.9 1.7 0.4 setosa\r\n 7 4.6 3.4 1.4 0.3 setosa\r\n 8 5.0 3.4 1.5 0.2 setosa\r\n 9 4.4 2.9 1.4 0.2 setosa\r\n 10 4.9 3.1 1.5 0.1 setosa\r\n Any idea? Thank you so much [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] cointegration rank
Hello Carlo, no, this is not possible, per se. In case of a structural break in terms of a one-time level shift, you might want to consider the function cajolst(). Another possibility would be to run a regression with the dummy-variables and use the fitted values for your data matrix x. That is, the data is 'pre-filtered' by the impact of the dummy variables. HTH, Bernhard Another question on cointegration... Is it possible to insert in the model dummy variables restricted in the cointegration space? Many thanks, Carlo On Nov 21, 2005 01:23 PM, Pfaff, Bernhard Dr. [EMAIL PROTECTED] wrote: Thanks a lot! I have another question on cointegration, so I will go on this post. Is it possible to estimate a cointegration with some exogenous explanatory variables? Since, after testing for exogeneity, I would like to re-estimate the relation keeping some of the previous endogenous as exogenous. Many thanks! Carlo Hello Carlo, you can use the 'dumvar' argument for his purpose, and exclude the relevant variables from your data matrix 'x'. HTH, Bernhard On Nov 21, 2005 11:21 AM, Pfaff, Bernhard Dr. [EMAIL PROTECTED] wrote: Dear R - helpers, I am using the urca package to estimate cointegration relations, and I would be really grateful if somebody could help me with this questions: After estimating the unrestriced VAR with ca.jo I would like to impose the rank restriction (for example rank = 1) and then obtain the restricted estimate of PI to be utilized to estimate the VECM model. Is it possible? It seems to me that the function cajools estimates the VECM without the restrictions. Did I miss something? How is it possible to impose them? Thanks a lot in advance! Carlo Hello Carlo, you can achieve this, by calculating your desired PI-matrix by hand, given the slots 'V' and 'W' of your ca.jo object and then execute a restricted OLS-estimation, if I understand your goal correctly. Please, bear in mind the non-uniqueness of the factorization of the PI-matrix by doing so. HTH, Bernhard __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html* Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] cointegration rank
Dear R - helpers, I am using the urca package to estimate cointegration relations, and I would be really grateful if somebody could help me with this questions: After estimating the unrestriced VAR with ca.jo I would like to impose the rank restriction (for example rank = 1) and then obtain the restricted estimate of PI to be utilized to estimate the VECM model. Is it possible? It seems to me that the function cajools estimates the VECM without the restrictions. Did I miss something? How is it possible to impose them? Thanks a lot in advance! Carlo Hello Carlo, you can achieve this, by calculating your desired PI-matrix by hand, given the slots 'V' and 'W' of your ca.jo object and then execute a restricted OLS-estimation, if I understand your goal correctly. Please, bear in mind the non-uniqueness of the factorization of the PI-matrix by doing so. HTH, Bernhard __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html* Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] cointegration rank
Thanks a lot! I have another question on cointegration, so I will go on this post. Is it possible to estimate a cointegration with some exogenous explanatory variables? Since, after testing for exogeneity, I would like to re-estimate the relation keeping some of the previous endogenous as exogenous. Many thanks! Carlo Hello Carlo, you can use the 'dumvar' argument for his purpose, and exclude the relevant variables from your data matrix 'x'. HTH, Bernhard On Nov 21, 2005 11:21 AM, Pfaff, Bernhard Dr. [EMAIL PROTECTED] wrote: Dear R - helpers, I am using the urca package to estimate cointegration relations, and I would be really grateful if somebody could help me with this questions: After estimating the unrestriced VAR with ca.jo I would like to impose the rank restriction (for example rank = 1) and then obtain the restricted estimate of PI to be utilized to estimate the VECM model. Is it possible? It seems to me that the function cajools estimates the VECM without the restrictions. Did I miss something? How is it possible to impose them? Thanks a lot in advance! Carlo Hello Carlo, you can achieve this, by calculating your desired PI-matrix by hand, given the slots 'V' and 'W' of your ca.jo object and then execute a restricted OLS-estimation, if I understand your goal correctly. Please, bear in mind the non-uniqueness of the factorization of the PI-matrix by doing so. HTH, Bernhard __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html* Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How can I test temporal autocorrelation of binary data?
Depending on what you are really want to infer from the autocorrelations, you want to consider the runs-test, too. HTH, Bernhard If you mean you want to test that there is no autocorrelation, then there is some information on using the Ljung-Box test on such data in the working paper 'Robustness of the Ljung-Box test and its rank equivalent' on the Burns Statistics website. The executive summary is that the test seems to do okay as long as one of the values is not too dominant. What 'dominant' means depends on the length of the series. If some one has a better answer, I'm keen to hear it. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) [EMAIL PROTECTED] wrote: Hi, I have a binary (o/1 - coded) data set and want to test it's autocorrelation structure. Is that function implemented in R? Can I use the ACF - funtion with binary data? Thanks for your help, Daniel __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html* Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] COM objects with early bindings in R
Dear list member, I am using the packages RDCOMClient and SWinTypeLibs and try to import a COM object (created in Delphi) in R that is of type 'early binding' instead of late 'late binding'. Is there a possibility to do this in R? Currently, the following returns an error message: l1 = LoadTypeLib(c:\\Programme\\INVESCO\\QaCalendar\\Calendar.dll) print(getTypeLibTypes(l1)) IQaCalPeriodicInitQaCalPeriodicIQaSeriesInit dispatchcoclass dispatch QaSeries_QaSerLib QaSerLib coclass dispatchcoclass IQaCalSporadicInitQaCalSporadic _QaCalendarLib dispatchcoclass dispatch QaCalendarLib QaCalendarIntersectRules QaDistanceRules coclass enum enum createCOMSClass(l1[[QaSerLib]], test) Error in generateOperators(libEntry, className) : invalid subscript type Any help, pointers or a working example is much appreciated. Best Regards, Bernhard platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor1.1 year 2005 month06 day 20 language R __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html