similar to: What is the equivalent function in R to xyplot in S?

Displaying 20 results from an estimated 7000 matches similar to: "What is the equivalent function in R to xyplot in S?"

2002 Jun 19
1
superscripts in xyplot labels
R-helpers; I tried to get a superscripted 3 in the following xyplot example but failed: >data(whiteside) >xyplot(Gas ~ Temp | Insul, whiteside, panel = function(x, y, ...) { panel.xyplot(x, y, ...) panel.lmline(x, y, ...) }, xlab = "Average external temperature (deg. C)", ylab = paste(paste("Gas consumption (1000", expression(ft^3),")"), aspect
2007 Dec 12
3
lm/model.matrix confusion (? bug)
Dear List-members, Hopefully someone will help through my confusion: In order to get the same coefficients as we get from the following ## require (MASS) summary ( lm(Gas ~ Insul/Temp - 1, data = whiteside) ) ...................... we need to do the following (if we use model.matrix to specify the model) ## summary ( lm(Gas ~ model.matrix(~ Insul/Temp - 1) - 1, data = whiteside) )
2008 Mar 05
1
testing for significantly different slopes
Hi, How would one go about determining if the slope terms from an analysis of covariance model are different from eachother? Based on the example from MASS: library(MASS) # parallel slope model l.para <- lm(Temp ~ Gas + Insul, data=whiteside) # multiple slope model l.mult <- lm(Temp ~ Insul/Gas -1, data=whiteside) # compare nested models: anova(l.para, l.mult) Analysis of Variance
2018 Dec 15
2
Documentation examples for lm and glm
A pragmatic solution could be to create a simple linear regression example with variables in the global environment and then another example with a data.frame. The latter might be somewhat more complex, e.g., with several regressors and/or mixed categorical and numeric covariates to illustrate how regression and analysis of (co-)variance can be combined. I like to use MASS's whiteside
2009 Mar 22
3
data analysis. R
so i am having this question what should i do if the give data file (.txt) has 4 columns, but different lengths? how can i read them in R? any idea for the following problem? Gas consumption (1000 cubic feet) was measured before and after insulation was put into a house. We are interested in looking at the effect of insulation on gas consumption. The average outside temperature (degrees celcius)
2018 Dec 16
3
Documentation examples for lm and glm
On Sat, 15 Dec 2018, frederik at ofb.net wrote: > I agree with Steve and Achim that we should keep some examples with no > data frame. That's Objectively Simpler, whether or not it leads to > clutter in the wrong hands. As Steve points out, we have attach() > which is an excellent language feature - not to mention with(). Just for the record: Personally, I wouldn't recommend
2003 Sep 24
1
Graph window is not available any more
Hi all, I have currently been using the book Modern Applied Statistics with S from Venables and Ripley. At chapter 6 on Linear Statistical models I wanted to produce the plot as shown by "Figure 6.1" using Whiteside's data. xyplot command seems not to work on my version of "R"(version 1.7.0) running on different environments (Win XP, Win 98 and Win 2000). I then used the
2000 Sep 26
3
lm -- significance of x coefficient when I(x^2) is used
In "Modern Applied Statistics with S-Plus" 3rd ed., footnote on page 153 regarding a model lm(Gas~Insul/(Temp+I(Temp^2))-1,whiteside), I read "Notice that when the quadratic terms are present, first degree coefficients mean 'the slope of the curve at temperature zero', so a non-significant value does not mean that the linear term is not needed.
2001 Jan 04
6
regression constraints?
gday R gurus, I have a multivariate regression for which I want to constrain the coefficients to be > 0. Is this possible? I've check the doco and searched CRAN but can't find anything. thanks, John Strumila -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2008 Feb 23
3
using subset() in data frame
R folks, As an R novice, I struggle with the mystery of subsetting. Textbook and online examples of this seem quite straightforward yet I cannot get my mind around it. For practice, I'm using the code in MASS Ch. 6, "whiteside data" to analyze a different data set with similar variables and structure. Here is my data frame: ###subset one of three cases for the variable
2018 Dec 15
0
Documentation examples for lm and glm
I agree with Steve and Achim that we should keep some examples with no data frame. That's Objectively Simpler, whether or not it leads to clutter in the wrong hands. As Steve points out, we have attach() which is an excellent language feature - not to mention with(). I would go even further and say that the examples that are in lm() now should stay at the top. Because people may be used to
2003 May 13
1
several regression lines in panel of xyplot (trellis graphics)
Dear r-help, I need to draw xyplot() graphs with several regression lines: one line for the whole range of x (the variable on the horizontal axis) and two additional lines for subranges of x. Is it possible to make first regression line (panel.lmline(x,y,...);) to be drawn on the whole graph and regression lines of the subsets to be drawn only over their subsets? I have defined
2018 Dec 17
0
Documentation examples for lm and glm
Thanks for the discussion. I do feel quite strongly that the variables should always be a part of a data frame. Then functions such as summary() and pairs() can operate on them all simultaneously.... regression is only one part of the analysis. And what if there are lots of variables? Have them all scattered about the workspace? One of them could be easily overwritten. The generic predict() will
2009 Sep 28
1
xyplot & lmline: error message.
Hi, I am trying to produce an xyplot with a regression line. The data should be represented as log/log but when I fit the lmline I receive an error message - the plot is fine without the log transformation, but the then the plot is meaningless. I know it must be something simple, but I just can't see it. Hope someone can help... Thanks. xyplot(log(Pk)~log(k),data=rwpk,cex=1,
2012 Oct 30
1
Is there an lm() equivalent of panel.lmline()?
panel.lmline returns intercept and slope of y ~ x subsetted to the combination of conditioning factors given to xyplot in lattice. for instance: xyplot(Xvalues ~ log(Qvalues)|Tfac, data = df7, panel = panel.lmline) I am looking to find the equivalent formulation for lm() proper. If I do this: lmcal <- lm(Xvalues ~ log(Qvalues):Tfac, data = df7) Only one value of the intercept is returned.
2011 Jul 19
1
notation question
Dear list, I am currently writing up some of my R models in a more formal sense for a paper, and I am having trouble with the notation. Although this isn't really an 'R' question, it should help me to understand a bit better what I am actually doing when fitting my models! Using the analysis of co-variance example from MASS (fourth edition, p 142), what is the correct notation for the
2011 Oct 21
1
lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth
In the HistData package, I have a data frame, PearsonLee, containing observations on heights of parent and child, in weighted form: library(HistData) > str(PearsonLee) 'data.frame': 746 obs. of 6 variables: $ child : num 59.5 59.5 59.5 60.5 60.5 61.5 61.5 61.5 61.5 61.5 ... $ parent : num 62.5 63.5 64.5 62.5 66.5 59.5 60.5 62.5 63.5 64.5 ... $ frequency: num 0.5 0.5
2005 Feb 10
1
xyplot() question
Dear R Users, I have an xyplot() where different plotting symbols are used for subgroups (originally used within S-Plus, but hopefully it?s also applicable to R users). How can I fit separate regression lines for every subgroup? So far, I can only plot the overall fitted line. The code looks like this: trellis.device() sps<-trellis.par.get("superpose.symbol") sps$pch<-1:7
2007 Jun 12
1
2 Trellis graphics question
1) I have a data that includes some "bad" data. I want to make a trellis plot where each panel contains a) A scatter plot of the "good" data b) A scatter plot of the "bad" data in a different color c) A best fit line of all the data, and d) A best fit line of the "good" data. I tried using xyplot and setting the "group" argument, but I'm
2011 Jul 28
2
not working yet: Re: lattice overlay
Hi Dieter and R community: I tried both of these three versions with ylim as suggested, none work: I am getting only single (pch = 16) not overlayed (pch =3) everytime. *vs 1* require(lattice) xyplot(Sepal.Length ~ Sepal.Width | Species , data= iris, panel= function(x, y, subscripts) { panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10)) panel.lmline(x, y, lty=4, col =