Displaying 20 results from an estimated 400 matches similar to: "the meaning of subscripts"
2006 Apr 25
4
Help needed
Hi,
I am trying to change a SAS macro to R.
here is my code. I get an error at the last line.
attach(fram)
dset1<-cbind(AGE,BMI,DEATH)
> BMIGRP<-cut(BMI,breaks=3,right=TRUE)
> AGEGRP<-floor(AGE/10)-2
> dset<-cbind(AGEGRP,BMIGRP,DEATH)
> maxage<-max(dset[,1])
> minage<-min(dset[,1])
> #maxcls<-dset[,2]
> #mincls<-dset[,2]
>
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
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 =
2007 Sep 10
1
lattice panel.lmline problem
I am wanting to generate panels showing scatterplots with the linear
fitted line for two groups within each panel superimposed.
I have two conditioning factors, "variable" and "Group" and I want
separate panels for each level of "variable"
with different symbols and "lmline"s for each level of "Group". However
all observations for a group are
2009 Jan 23
1
lattice: reverse order of panel.lmline, panel.smooth
Hi,
is it possible to reverse the order in which panel.lmline() or panel.smooth()
operation in xyplot() ? This type of situation might occur when plotting some
variable with depth, but the relation we want to describe is variable ~
depth, and not depth ~ variable, as the plotting formula would suggest.
# an example:
d <- 1:100
v <- d * rnorm(100)
xyplot(d ~ v, ylim=c(100,0),
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,
2011 Sep 09
1
Adding groups to regression line panel function in Lattice
I wish to display a single-panel Lattice figure with grouped data and fitted regression lines. I don't seem to be able to get the
individual regression lines to display, e.g.;
d <- data.frame(q = rep(1:6, each=10), cc = rep(seq(10,100, 10),6)) # create data frame with group identifier 'q', independent variable cc
d$ba = d$q*0.1*d$cc + 5*rnorm(nrow(d))
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.
2010 Oct 07
1
Lattice: Histogram in splom diagonals
Dear list, I want to plot several variables with splom and in the main
diagonal, instead of the variable names, I'd like to plot an histogram of
corresponding variables. Searching I did not find the correct syntax, only
some tips in an old post in the list, but this comments help to plot only
density lines instead of histograms. I had some code, but it fails to plot
(I've commented the
2009 May 10
2
plot(survfit(fitCox)) graph shows one line - should show two
R 2.8.1
Windows XP
I am trying to plot the results of a coxph using plot(survfit()). The plot should, I believe, show two lines one for survival in each of two treatment (Drug) groups, however my plot shows only one line. What am I doing wrong?
My code is reproduced below, my figure is attached to this EMail message.
John
> #Create simple survival object
>
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
2009 May 09
4
how to get design matrix?
How do you get the design matrix R used when calculating ANOVA?
--
View this message in context: http://www.nabble.com/how-to-get-design-matrix--tp23464638p23464638.html
Sent from the R help mailing list archive at Nabble.com.
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
2010 Feb 08
3
What is the equivalent function in R to xyplot in S?
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, ...)
panel.lmline(x, y, ...)
}, xlab = "Average external temperature (deg. C)",
ylab
2004 Apr 14
1
ltext, plotmath, and substitute
I am interested to use plotmath functions within a panel function but am having
some problems getting the code right. Within each panel I am plotting the data,
fitting a regression line, and would like to print the regression equation.
Here is a trivial example of what I'd like to do:
# generate simple data
tmp.df <- data.frame(id = rep(1:4, each=4),
time = rep(1:4, 4),
das =
2018 May 30
2
Filtering using multiple rows in dplyr
Hi Folks,
I have just started using dplyr and could use some help getting unstuck. It could well be that dplyr is not the package to be using, but let me just pose the question and seek your advice.
Here is my basic data frame.
head(h)
subject ageGrp ear hearingGrp sex freq L2 Ldp Phidp NF SNR
1 HALAF032 A L A F 2 0 -23.54459 55.56005 -43.08282
2002 Mar 05
2
identify in lattice
Does identify work in lattice plots? I tried this in R 1.4.1 (original
release) on my Win2000 machine with lattice 0.4-0 and grid 0.5-1.
> xyplot(y ~ x,
+ panel=function(x, y, ...){
+ panel.xyplot(x, y, col=2, pch=20, ...)
+ panel.lmline(x, y, type = "l")
+ identify(x, y)
+ })
I get a change of cursor after the data points and the LS line are plotted
2010 Oct 11
3
help with simple but massive data transformation
I have data that looks like this:
start end value
1 4 2
5 8 1
9 10 0
I want to transform the data so that it becomes:
startend value
1 2
2 2
3 2
4 2
5 1
6 1
7 1
8 1
9 0
10 0
----
I've
2007 Oct 04
2
plot from source file
Dear list
Maybe someone can help with the following problem:
I have a source file containing the following code for plotting:
pdf(file = 'data/mario/boxplot.pdf')
bwplot(sig100 ~ target | group, data = fish, main = 'Boxplot der
Signale in 100 Zellen nach Gruppe', xlab = '', ylab = 'Anzahl der
Signale')
dev.off()
pdf(file = 'data/mario/xyplot.pdf')