[R] Lisp-like primitives in R
I mainly program in Common Lisp and use R for statistical analysis. While in R I miss the power and ease of use of Lisp, especially its many primitives such as find, member, cond, and (perhaps a bridge too far) loop. Has anyone created a package that includes R analogs to a subset of Lisp functions? Chris Elsaesser, PhD Principal Scientist, Machine Learning SPADAC Inc. 7921 Jones Branch Dr. Suite 600 McLean, VA 22102 703.371.7301 (m) 703.637.9421 (o) __ 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] using lm() with variable formula
New to R; please excuse me if this is a dumb question. I tried to RTFM; didn't help. I want to do a series of regressions over the columns in a data.frame, systematically varying the response variable and the the terms; and not necessarily including all the non-response columns. In my case, the columns are time series. I don't know if that makes a difference; it does mean I have to call lag() to offset non-response terms. I can not assume a specific number of columns in the data.frame; might be 3, might be 20. My central problem is that the formula given to lm() is different each time. For example, say a data.frame had columns with the following headings: height, weight, BP (blood pressure), and Cals (calorie intake per time frame). In that case, I'd need something like the following: lm(height ~ weight + BP + Cals) lm(height ~ weight + BP) lm(height ~ weight + Cals) lm(height ~ BP + Cals) lm(weight ~ height + BP) lm(weight ~ height + Cals) etc. In general, I'll have to read the header to get the argument labels. Do I have to write several functions, each taking a different number of arguments? I'd like to construct a string or list representing the varialbes in the formula and apply lm(), so to say [I'm mainly a Lisp programmer where that part would be very simple. Anyone have a Lisp API for R? :-}] Thanks, chris Chris Elsaesser, PhD Principal Scientist, Machine Learning SPADAC Inc. 7921 Jones Branch Dr. Suite 600 McLean, VA 22102 703.371.7301 (m) 703.637.9421 (o) __ 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] Modified Sims test
Does anyone know of a package that includes the Modified Sims test [Gewerke, 1983, Sims, 1972]? This test is used in econometrics and is a kind of alternative to the Granger test [Granger, 1969], which is in the package lmtest. Thanks in advance, chris Refernces: Gewerke, J., R. Meese, and W. Dent (1983), "Comparing Alternative Tests of Causality in Temporal Systems: Analytic Results and Experimental Evidence." Journal of Econometrics, 83, 161-194. Granger, C.W.J. (1969), "Investigating Causal Relations by Econometric Methods and Cross-Spectral Methods," Econometrica, 34, 424-438. Sims, C. (1972), "Money, Income and Causality," American Economic Review, 62, 540-552. Chris Elsaesser, PhD703.637.9421 (o) Principal Geospatial Scientist 703.371.7301 (m) SPADAC Inc. 7921 Jones Branch Dr. Suite 600 McLean, VA 22102 __ 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] ISO Sims test
Does anyone know of a package that includes the Modified Sims test [Sims, 1972]? This test is used in econometrics and is a kind of alternative to the Granger test [Granger, 1969], which is in the package lmtest. Thanks in advance, chris Refernces: Granger, C.W.J. (1969), "Investigating Causal Relations by Econometric Methods and Cross-Spectral Methods," Econometrica, 34, 424-438. Sims, C. (1972), "Money, Income and Causality," American Economic Review, 62, 540-552. Chris Elsaesser, PhD703.637.9421 (o) Principal Geospatial Scientist 703.371.7301 (m) SPADAC Inc. 7921 Jones Branch Dr. Suite 600 McLean, VA 22102 __ 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.