[R] What is the difference between typeof and storage.mode?

2010-02-10 Thread bluesky315
S Programming by Venables and Ripley (2000) says on page 8, "R objects have another way to give information using the function \tttext{typeof}, which often gives the same information as \tttext{storage.mode}." It implies that there are some differences between typeof and storage.mode. However, acc

[R] How to reverse the axis direction in log plot?

2010-02-08 Thread bluesky315
The following command gives me a plot where the axes are in log scale but 'x' increases in the right direction. plot(1:10,1:10, log='xy') I want to change the plot such that it is still in log scale but 'x' decreases rather increases in the right direction. I'm wondering if there is an option to

Re: [R] How to reverse the axis direction in log plot?

2010-02-08 Thread bluesky315
On Mon, Feb 8, 2010 at 11:13 AM, Hrishi Mittal wrote: > > plot(1:10,1:10,log='xy',xlim=c(10,1)) What if I want to use the automatically computed limits? I could use the following command. But it is not a very clean user interface, as the user has to compute the min and the max. Is there a way tha

[R] What is the equivalent function in R to xyplot in S?

2010-02-08 Thread bluesky315
Page 140 of MASS uses the function xyplot. But I don't find it in R. Is there a package that I should load to use xyplot. Or there is a function with a different name in R that does the same thing as xyplot in S. xyplot(Gas ~ Temp | Insul, whiteside, panel = function(x, y, ...) { panel.xyplot(x, y

[R] "1 observation deleted due to missingness" from summary() on the result of aov()

2010-02-08 Thread bluesky315
I have the R code at the end. The last command gives me "1 observation deleted due to missingness". I don't understand what this error message. Could somebody help me understand it and how to fix the problem? > summary(afit) Df Sum Sq Mean Sq F value Pr(>F) A 2 0.328 0

[R] Interpretation of high order interaction terms.

2010-02-09 Thread bluesky315
I have difficulties in interpreting high order interaction terms in high-way ANOVA. According to Introductory Statistics with R by Peter Dalgaard (Section 12.5), "The exact definition of the interaction terms and the interpretation of their associated regression coefficients can be elusive. Some

[R] The default argument 'envir' of eval()

2010-02-09 Thread bluesky315
In ?eval, it says     ...  If ‘envir’ is not     specified, then the default is ‘parent.frame()’ (the environment     where the call to ‘eval’ was made). I tried the following example with "eval(expr)"  and "eval(expr, parent.frame())" in f(). The results are different, which are not consistent w

Re: [R] Interpretation of high order interaction terms.

2010-02-09 Thread bluesky315
This is useful. But it is not exactly what I am looking for. I can use 'contrast' to infer linear combination factor level means as discussed in Statistical Inference by Casella and Berger. What is the equivalent 'contrast' for interaction terms? Is there a book that discuss this? On Tue, Feb 9, 2

[R] Model matrix using dummy regressors or deviation regressors

2010-02-09 Thread bluesky315
The model matrix for the code at the end the email is shown below. Since the model matrix doesn't have -1, I think that it is made of dummy regressors rather than deviation regressors. I'm wondering how to make a model matrix using deviation regressors. Could somebody let me know? > model.matrix(a

[R] The 'variables' attribute of terms()

2010-02-09 Thread bluesky315
I got the following output when I try the code at the end. > str(attr(terms1, 'variables')) language list(skips, Panel, Opening) > class(attr(terms1, 'variables')) [1] "call" I checked ?call, where 'call' is a function. Could somebody let me know what a 'call' class is and what 'language' is? #

Re: [R] Model matrix using dummy regressors or deviation regressors

2010-02-09 Thread bluesky315
On Tue, Feb 9, 2010 at 6:09 PM, John Fox wrote: > Dear bluesky315, > > There are several ways in R to determine regressors associated with factors. > One way is to set the global contrasts option. To get "deviation" > regressors, use options(contrasts=c("contr