similar to: Re gression for levels of a factor/xyplot type="r"

Displaying 20 results from an estimated 11000 matches similar to: "Re gression for levels of a factor/xyplot type="r""

2009 Apr 14
1
Lattice xyplot: Line and Rectangle in legend.
Hello fellow R users, I have a problem. I have created a barchart overlayed by an xyplot line, both of which read off the same Y axis. The problem comes when I try to generate a key. It seems that I can only create either two lines, or two rectangles. I would much prefer to have the barchat series depicted by a rectangle, and the xyplot series by a line. Is there a way to do this? Your help
2009 Mar 10
5
2 Simple Lattice Plot Questions
Hi, I have created the plot below and have a few questions about changes. 1) How do I change the "Year" title of each plot so it reads from the top "2006","2007","2008","2009". 2) How do I get rid of those vertical grey bars in the title bar of each plot? I apologise for my ignorance... one of those days :( James
2009 Jan 07
2
Plotting a graph for every Level of a Factor
Hello, I'm sorry if this seems similar to my last post but I thought it was significantly different to warrent a new thread. Using the dataset below, is there a way to generate a bar/line plot for the TACC/Catch of every lvl of stock? i.e. OR1,OR3,OR5. The picture at the bottom of this post is an example of the bar/line plot for OR1 which was generated when OR1 was the only stock in the
2009 Nov 06
3
Calculate Mean for each Treatment/Trial Interaction in DF
Hi, I am create a new DF that summarizes the mean angle per treatment/trial, of the original DF (see below). I have had some success using: (tapply(df$Angle, INDEX=interaction(df$State, df$Trial), FUN=mean)); however, this gives the answer as a list, which means I would have to split the name to get the categories back. Does anyone know a simple way to transform the Original DF into Summary
2009 Jan 15
1
Zoo Plot Can't Get Rid of Box
Hi, I apologise for the stupid question but how to you get rid of the box around a plot in the package zoo? I can't seem to find an equivalent for bty="l" i.e. just x and y axis. Cheers James -- View this message in context: http://www.nabble.com/Zoo-Plot-Can%27t-Get-Rid-of-Box-tp21468452p21468452.html Sent from the R help mailing list archive at Nabble.com.
2009 Jan 16
1
XYplot in Lattice Package
Dear R-Users I have 2 questions to do with XYplot. 1) I am trying to use the XYplot function to generate multiple line graphs with the legend outside the plot. I am using the following loop for each graph: library(lattice) for (i in x.sp){ xyplot(Catch~Year, df, groups = Stock, type="a",auto.key = list(space = "top", points = FALSE, lines = TRUE,columns = 4)) }
2009 Jul 27
2
Split rownames into factors
Hi Guys, I was wondering how you would go about solving the following problem: I have a list where the grouping information is in the row names. Rowname [,1] X1Jan08 324 X1Jun08 65 X1Dec08 543 X2Jan08 23 X2Jun08 54 X2Dec08 8765 X3Jan08 213 X3Jun08 43 X3Dec08 65 How can I create the following dataframe: Value Date Group [1,] 324 Jan 08 X1 [2,] 65 Jun 08
2009 Mar 22
5
If statement generates two outputs
Hi, How do I tell an if statement to generate two seperate outputs. E.g If X>5 I want to create df1 and df2: if (X>5) {df1<-c(4,5,6,7,8) AND df2<-c(9,10,11,12,13)} Thanks, James -- View this message in context: http://www.nabble.com/If-statement-generates-two-outputs-tp22650844p22650844.html Sent from the R help mailing list archive at Nabble.com.
2009 Jan 14
1
Help with Plot/Legend
Dear R-Users I have 2 questions: Firstly, If I create a matplot and legend for multiple vectors and then tag another vector on using matlines (e.g. a 'total' of all vectors), is there anyway to add the new line to the legend without recreating it? I have created the plot this way because I would like to define the lty and lwd for the 'total' vector so that it can be
2009 Jul 20
3
Re gression using age and Duration of disease as a continous factors
Please explain me as what it means and how this analysis can be done using R and which library(ies) are needed. Thanks -- View this message in context: http://www.nabble.com/Regression-using-age-and-Duration-of-disease-as-a-continous-factors-tp24574133p24574133.html Sent from the R help mailing list archive at Nabble.com.
2009 Oct 05
2
Loop function/comparison operator problem
Hi There, I have created the following function format<- function(){ repeat { form<-readline(paste("\nIn what format do you want to save these plots?\nChoose from: wmf, emf, png, jpg, jpeg, bmp, tif, tiff, ps, eps, or pdf.\nNote: eps is the suggested format for publication quality plots.\nPlot format --> ")); cat("\nI'm sorry, I don't know what that format
2009 Sep 01
1
Re gression - cluster option in STATA
Hello In STATA there is command which has regression with clustering option. Can anyone tell me what is the command for the same in R for example in STATA its regress Height Weight, cluster(id) Thanks in Advance Regards Sunita -- View this message in context: http://www.nabble.com/Regression---cluster-option-in-STATA-tp25241948p25241948.html Sent from the R help mailing list archive at
2009 Jul 20
1
Re gression for loop test HELP! URGENT!
Hi everyone! I'm new to R, and I'm stuck on a problem I don't know how to approach. I have calculated a regression in the form of M ~ D + O + S, and I would like to take this regression and test it with other samples, 5 at a time(5 meaning 5 set, each consisting M, D, O, and S of a specific date). I assume I'll need a for loop. Right now, My data of M, D, O, and S are all stored in
2008 Mar 25
1
re gression trees: mean square vs. absolute errors
Hi, I am working with CART regression now to predict a probability; the response is binary. Could anyone tell me in which cases it is better to use mean square error for splitting nodes and when mean absolute error should be preferred. I am now using the default (MSE) version and I can see that the obtained optimal tree is very different from the tree with the least mean absolute error. Thanks in
2008 Aug 20
0
Re gression with Intersection Constraint
Hi, Previously I posted a thread asking help on how to best-fit (in the least squares sense) a straight line through a set of data points. Thanks a lot to all replying to it. I managed it in Matlab using a function 'fit_3D_data' (link: http://webscripts.softpedia.com/script/Scientific-Engineering-Ruby/Statistics-and-Probability/Orthogonal-Linear-Regression-in-3D-space-35532.html). But to
2009 Oct 28
5
re gression with multiple dependent variables?
i have a series of regressions i need to run where everything is the same except for the dependent variable, e.g.: lm(y1 ~ x1+x2+x3+x4+x5, data=data) lm(y2 ~ x1+x2+x3+x4+x5, data=data) lm(y3 ~ x1+x2+x3+x4+x5, data=data) is it possible to run all these regs with a single command? given that the bulk of the work for linear regressions is inverting a matrix that depends only on the independent
2009 Jul 09
2
Lattice xyplot: same scales within one factor
I am using R 2.8.1 and lattice to produce xyplots conditioned on two factors. What I would like is to have the scales be free between values of one factor, but some within. Thus, in the example: xyplot(mpg ~ disp | factor(gear) + factor(cyl), mtcars, scales=list(x=list(relation="free"))) rather than having the x scales be free within a gear as well, I want it to be the same for
2010 Aug 22
0
lattice::xyplot() with one factor for points and another for lines - solution
Hi: Yesterday, I posted a question regarding how to handle different graphical behavior between two factors in xyplot() [package lattice]. After a public and private reply from Deepayan Sarkar, the problem has been resolved nicely, including the addition of a stacked legend for the two factors in question. The latter requires package latticeExtra. library(lattice) library(latticeExtra) # Test
2011 Mar 02
1
how to delete empty levels from lattice xyplot
Hello All, I try to use the attached code to produce a cross over plot. There are 13 subjects, 7 of them in for/sal group, and 6 of them in sal/for group. But in xyplot, all the subjects are listed in both subgraphs. Could anyone help me figure out how to get rid of the empty levels? Thanks library(lattice) pef1 <- c(310,310,370,410,250,380,330,370,310,380,290,260,90) pef2 <-
2010 Aug 21
1
lattice::xyplot() with one factor for points and another for lines
Hi: In lattice, how does one handle separate graphical behavior for two different factors? In the xyplot below, the objective is to use the levels of one factor to distinguish corresponding shapes and colors, and the levels of the other factor to perform level-wise loess smooths. # Illustrative data: d <- data.frame(time = rep(1:8, each = 6), val = rnorm(48), gp1 =