similar to: How to control in order of groups in xyplot

Displaying 20 results from an estimated 20000 matches similar to: "How to control in order of groups in xyplot"

2011 Mar 13
1
How to draw different series for different groups in xyplot
Hi guys, I got a problem when I was trying to use lattice to do some plot. Below is one working example which can generate one curve for A and one curve for B in each subplot. However, I would like to just show the points for B, not connecting the dots. As for A, I still want a curve (dots are connected). Is there any people having any suggestions. Data are attached. Thanks a lot, --Jerry
2006 Aug 31
3
what's wrong with my simulation programs on logistic regression
Dear friends, I'm doing a simulation on logistic regression model, but the programs can't work well,please help me to correct it and give some suggestions. My programs: data<-matrix(rnorm(400),ncol=8) #sample size is 50 data<-data.frame(data) names(data)<-c(paste("x",1:8,sep="")) #8 independent variables,x1-x8; #logistic regression model is
2006 Aug 20
2
how to the p-values or t-values from the lm's results
Dear friends, After running the lm() model, we can get summary resluts like the following: Coefficients: Estimate Std. Error t value Pr(>|t|) x1 0.11562 0.10994 1.052 0.2957 x2 -0.13879 0.09674 -1.435 0.1548 x3 0.01051 0.09862 0.107 0.9153 x4 0.14183 0.08471 1.674 0.0975 . x5 0.18995 0.10482 1.812 0.0732 . x6 0.24832 0.10059 2.469 0.0154 * x7
2013 Oct 04
3
quote a column of a dataframe by its name
Dear All, I have a question, suppose X is a dataframe, with column names as "x1", "x2", "x3", ..... And I would like to use the i-th column by X[,'xi']. But it seems the single quote and double quote are different. So if I run X[, names(X)[i]], it has some error. Please use the below example code X = matrix(rnorm(50),ncol = 5) X = data.frame(X)
2012 Aug 01
2
how to subset the data frame by lines
I defined a data.frame by a two-dimensional array. > aa = data.frame(rbind( 11:20, 1:10)) > aa X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 11 12 13 14 15 16 17 18 19 20 2 1 2 3 4 5 6 7 8 9 10 Now I want to use the data in the second line of aa which from 1 to 10 to output.But I find that when I use the aa[[1]][1:10] and it seems be mistake. aa[[1]][1:10] [1] 11 1 NA NA NA
2007 Jan 30
2
R and S-Plus got the different results of principal component analysis from SAS, why?
Dear Rusers, I have met a difficult problem on explaining the differences of principal component analysis(PCA) between R,S-PLUS and SAS/STATA/SPSS, which wasn't met before. Althought they have got the same eigenvalues, their coeffiecients were different. First, I list my results from R,S-PLUS and SAS/STATA/SPSS, and then show the original dataset, hoping sb. to try and explain it.
2005 Jan 21
2
Selecting a subplot of pairs
Hello, I'm trying to plot a set of 3 dependant variables (y) against 4 predictors (x) in a matrix-like plot, sharing x- an y-axis for all the plot on the same column/line : y1/x1 y1/x2 y1/x3 y1/x4 y2/x1 y2/x2 y2/x3 y2/x4 y3/x1 y3/x2 y3/x3 y3/x4 In fact, this plot is a rectangular selection of the result of pairs(), limited to the relations between x's and y's
2008 Mar 29
1
Tabulating Sparse Contingency Table
I have a sparse contingency table (most cells are 0): > xtabs(~.,data[,idx:(idx+4)]) , , x3 = 1, x4 = 1, x5 = 1 x2 x1 1 2 3 1 0 0 31 2 0 0 112 3 0 0 94 , , x3 = 2, x4 = 1, x5 = 1 x2 x1 1 2 3 1 0 0 0 2 0 0 0 3 0 0 0 , , x3 = 3, x4 = 1, x5 = 1 x2 x1 1 2 3 1 0 0 0 2 0 0 0 3 0 0 0 , , x3 = 1, x4
2010 Dec 14
2
How to bind models into a list of models?
Hi R-helpers, I have a character object called dd that has 32 elements each of which is a model formula contained within quotation marks. Here's what it looks like: > dd [1] "lm(y ~ 1,data=Cement)" "lm(y ~ X,data=Cement)" "lm(y ~ X1,data=Cement)" [4] "lm(y ~ X2,data=Cement)" "lm(y ~
2012 Jan 05
1
delete.response leaves response in attribute dataClasses
I posted this one as an R bug (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14767), but Prof. Ripley says I'm premature, and I should raise the question here. Here's the behavior I assert is a bug: The output from delete.response on a terms object alters the formula by removing the dependent variable. It removes the response from the "variables" attribute and it changes
2013 Apr 13
1
how to add a row vector in a dataframe
Hi, Using S=1000 and simdata <- replicate(S, generate(3000)) #If you want both "m1" and "m0" #here the missing values are 0 res1<-sapply(seq_len(ncol(simdata.psm1)),function(i) {x1<-merge(simdata.psm0[,i],simdata.psm1[,i],all=TRUE); x1[is.na(x1)]<-0; x1}) res1[,997:1000] #????? [,1]???????? [,2]???????? [,3]???????? [,4]??????? #x1??? Numeric,3000 Numeric,3000
2005 Oct 05
1
Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004613C000257091_= Content-Type: text/plain; charset="US-ASCII" And some more informastion I forgot. R does not crash if I write out the formula: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <-
2008 May 06
2
single plot statement, multiple plots
Hi R, par(mfrow=c(2,2)) x1=(1:5)^1; x2=(1:5)^2; x3=(1:5)^3; x4=(1:5)^4 I need to write a single plot statement, which creates 4 plots (for x1, x2, x3 and x4) in the graphics window, without using 'for' loop. Is this possible? Does 'do.call' help in this context? Or do I have any option in the 'plot' statement itself to do this? Thanks in advance, Shubha This
2006 Aug 16
1
Specifying Path Model in SEM for CFA
I'm using specify.model for the sem package. I can't figure out how to represent the residual errors for the observed variables for a CFA model. (Once I get this working I need to add some further constraints.) Here is what I've tried: model.sa <- specify.model() F1 -> X1,l11, NA F1 -> X2,l21, NA F1 -> X3,l31, NA F1 -> X4,l41, NA F1 -> X5, NA, 0.20
2003 Oct 05
3
stepAIC problem
Dear R-users I have a probelm running stepAIC in R1.7.1 I wrote a program which used stepAIC as a part of it, and it worked fine while I was using the previous version of R1.7.0. However, I found the program did not work any more. Now, R produces a message which tells "Error in as.data.frame.default(data) : can't coerce function into a data.frame" every time I run the part of
2005 Jun 07
1
Help with possible bug (assigning NA value to data.frame) ?
There's something peculiar that I do not understand here. However, did you realize that the thing you are assigning into parts of `a' is NULL? Check you're my.test.boot.ci.1: It's NULL. Be that as it may, I get: > a <- data.frame(matrix(1:4, nrow=2), X3=NA, X4=NA) > a X1 X2 X3 X4 1 1 3 NA NA 2 2 4 NA NA > a[a$X1 == 1,]$X3 <- NULL > a X1 X2 X3 X4 1 1
1999 Aug 05
1
pairwise scatterplot matrix
Dear Friends: I like so much to work with R program. Congratulations for your work. I need R for work with multivariate data. My question is: With the pairs(X) command my output is a pairwise scatterplot symmetric matrix. Like: | X1 |X1 vs X2|X1 vs X3|X1 vs X4| |X2 vs X1| X2 |X2 vs X3|X2 vs X4| |X3 vs X1|X3 vs X2| X3 |X3 vs X4| |X4 vs X1|X4 vs X2|X4 vs X3| X4 | It is
2008 Aug 01
5
drop1() seems to give unexpected results compare to anova()
Dear all, I have been trying to investigate the behaviour of different weights in weighted regression for a dataset with lots of missing data. As a start I simulated some data using the following: library(MASS) N <- 200 sigma <- matrix(c(1, .5, .5, 1), nrow = 2) sim.set <- as.data.frame(mvrnorm(N, c(0, 0), sigma)) colnames(sim.set) <- c('x1', 'x2') # x1 & x2 are
2012 Sep 12
3
how to create a substraction matrix (subtract a row of every column from the same row in other columns)
Hello I have data like this x1 x2 x3 x4 x5 I want to create a matrix similar to a correlation matrix, but with the difference between the two values, like this x1 x2 x3 x4 x5 x1 x2-x1 x3-x1 x4-x1 x5-x1 x2 x3-x2 x4-x2 x5-x2 x3 x4-x3 x5-x3 x4 x5-x4 x5 Then I
2004 Sep 27
1
random discrete from the first tuple
Dear UseR I have a dataset, for instance x1(A, B, C), x2(M,F), x3(X1,X2,X3,X4) and x4(W,F,P). I want to make a small dataset with the random tuple. I know package e1071 can handle a random discrete, > library(e1071) > x1 <- rdiscrete(6, c(2,2,2), c("A","B","C")) > x2 <- rdiscrete(6, c(3,3), c("M","F")) > x3 <-