search for: y3

Displaying 20 results from an estimated 330 matches for "y3".

2009 Dec 01
1
Multiple grouping on the X axis.
...n do the same thing, but at ~$200 a year the licensing is counterproductive. Thanks for any help. Data input: Loaded from a CSV file. Physical_1 Logical_1 Logical_2 Data_1 Data_2 x Y Z2 54 56 x Y2 Z2 53 55 x Y3 Z2 52 54 x2 Y Z 60 58 x2 Y2 Z 59 57 x2 Y3 Z 58 56 x3 Y Z 56 53 x3 Y2 Z 55 52 x3...
2012 Jan 22
1
Calling update on an lm-object inside a function
...of a function is straight forward: x <- 1:5 y <- c(1,2,3,3,6) mm <- lm(y~x) y2 <- c(1,3,3,4,6) mm2<- update(mm, y2 ~ .) But I want to make the update inside a function (where the new response variable is declared inside the function). If I do foo <- function(mod){ y3 <- c(1,3,3,4,6) update(mod, y3 ~ .) } Then I get foo(mm) Error in eval(expr, envir, enclos) : object 'y3' not found (because y3 is not known in the global environment - I suppose). To fix this I do foo2 <- function(mod){ y3 <- c(1,3,3,4,6) mod2 <- eval(getCall(m...
2006 May 30
2
merging
...ant the same as: rbind(y, y2) in this case. This is specific example of situation where two data matrices have same column variables and all I want is to stick the two sets of rows together, but I have been using merge for cases such as the one below, where the second matrix has extra column(s): y3 <- matrix(c(0,1,1,1,0,0,0,4,4,5,6,7), ncol = 4, byrow = TRUE) rownames(y3) <- c("d","e","f") colnames(y3) <- c("1","2","3","4") y3 merge(y, y3, all = TRUE, sort = FALSE) We don't know before hand if the columns will...
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 and excluding those within x's and y's. I managed to recreate such a plot using a script with layout(), axis() and so on, but I was won...
2008 Dec 29
4
Merge or combine data frames with missing columns
Hi R-experts, suppose I have a list with containing data frame elements: [[1]] (Intercept) y1 y2 y3 y4 -6.64 0.761 0.383 0.775 0.163 [[2]] (Intercept) y2 y3 -3.858 0.854 0.834 Now I want to put them into ONE dataframe like this: (Intercept) y1 y2 y3 y4...
2010 Feb 28
4
Reducing a matrix
I wish to rearrange the matrix, df, such that all there are not repeated x values. Particularly, for each value of x that is reated, the corresponded y value should fall under the appropriate column. For example, the x value 3 appears 4 times under the different columns of y, i.e. y1,y2,y3,y4. The output should be such that for the lone value of 3 selected for x, the corresponding row entries with be 7 under column y1, 16 under column y2, 12 under column y3 and 18 under column y4. This should work for the other rows of x with repeated values. df x y1 y2 y3 y4 1 3 7 NA NA NA 2...
2005 Dec 08
2
how to change a dataframe with characters to a numeric matrix?
hi netters, i have a dataframe TEST like this: Y1 Y2 Y3 X1 4 7 8 X2 6 2 Z X3 8 0 1 i would like to change it to a numeric matrix, replacing "Z" with NA Y1 Y2 Y3 X1 4 7 8 X2 6 2 NA X3 8 0 1 i've tried the function data.matrix but it didn't work. is there any easy way to do this? thanks a lot!
2011 Jan 19
2
Reshape
Hi - I'm up against a complicated reshape problem. I have data of the form X1,Y1,hr1,hr2,hr3 X1,Y2,hr1,hr2,hr3 X1,Y3,hr1,hr2,hr3 X2,Y1,hr1,hr2,hr3 X2,Y2,hr1,hr2,hr3 X2,Y3,hr1,hr2,hr3 where X and Y are factors and the hr(1,2,3) are values. I need it as ,X1, X2 Y1,hr1,hr1 Y1,hr2,hr2 Y1,hr3,hr3 Y2,hr1,hr1 Y2,hr2,hr2 Y2,hr3,hr3 .., Any hints? I've been at it for hours. p -- View this message in context:...
2005 Apr 04
1
custom loss function + nonlinear models
Hi all; I'm trying to fit a reparameterization of the assymptotic regression model as that shown in Ratkowsky (1990) page 96. Y~y1+(((y2-y1)*(1-((y2-y3)/(y3-y1))^(2*(X-x1)/(x2-x1))))/(1-((y2-y3)/(y3-y1))^2)) where y1,y2,y3 are expected-values for X=x1, X=x2, and X=average(x1,x2), respectively. I tried first with Statistica v7 by LS and Gauss-Newton algorithm without success (no convergence: predictors are redundant....). Then I tried with the op...
2010 Jul 12
3
Continuing on with a loop when there's a failure
Hi R sages, Here is my latest problem. Consider the following toy example: x <- read.table(textConnection("y1 y2 y3 x1 x2 indv.1 bagels donuts bagels 4 6 indv.2 donuts donuts donuts 5 1 indv.3 donuts donuts donuts 1 10 indv.4 donuts donuts donuts 10 9 indv.5 bagels donuts bagels 0 2 indv.6 bagels donuts bagels 2 9 indv.7 bagels donuts bagels 8 5 indv.8 bagels donuts bagels 4 1 indv.9 donuts donuts donuts 3 3 ind...
2011 Aug 15
1
update() ignores object
...cting the name of the term in a regression model that dropterm specifies as the least significant one, and I'm assigning this name to an object. However, when I use update(), it ignores this object. Is there a way I can make it not ignore it? A reproducible example is below: > lm(x1~1+y1*y2+y3+y4,data=anscombe)->my.lm > rownames(dropterm(my.lm,test="F",sort=TRUE))[1]->my.object > my.object [1] "y1:y2" > update(my.lm,.~.-my.object) Call: lm(formula = x1 ~ y1 + y2 + y3 + y4 + y1:y2, data = anscombe) Coefficients: (Intercept) y1 y2...
2008 Aug 13
1
summary.manova rank deficiency error + data
...0,0.163475,0.123046,0.156354,0.126067, 0.105726,0.124713,0.126821,0.085584,0.093432,0.108858,0.157742,0.120533,0.141309,0.122595, 0.118340,0.153088,0.155897,0.183582,0.160975,0.181143,0.139314,0.186636,0.103449,0.116415,0.114275) ) ,names = c("GROUP", "Y1", "Y2", "Y3", "Y4","Y5") ,row.names = seq(1:31) ,class = "data.frame" ) summary(manova(cbind(Y1,Y2,Y3,Y4,Y5)~GROUP, test), test = "Wilks") #Error in summary.manova(manova(cbind(Y1, Y2, Y3, Y4, Y5) ~ GROUP, test), : residuals have rank 3 < 5 #***************...
2006 Jun 21
4
help on ploting various lines
Dear All, I tried to plot a variety of lines(curves) on same figure. What I did is, plot(x=x1,y=y1) lines(x=x2,y=y2) lines(x=x3,y=y3) ... In my data, the maximum of y1 is much smaller than those maximums of other y vectors. So, in the figure I got, there are some curves which are not complete, I mean, they were cut off at the maximum of y1 at the y axis. Could anybody point out some right commands I need use? Thanks! Best, Ca...
2010 Nov 19
3
assigment
Hello R Users, I have vectors x <- c("a2","b7","c8") y1 <- c(1,2,3,2) y2 <- c(4,2,7,5,4,3,8) y3 <- c(1:10) and I want to assign values form vector y1 to a new variable which name comes from the 1st value of the vector x etc. How to do it using only vector x. As a result I should have: a2 <- y1 b7 <- y2 c8 <- y3 More general problem: I have 2 txt files. First is a one column C4 C...
2010 Oct 21
1
All other variables in upper scope arg for stepAIC
Hi - I am trying to substitute for "the_other_y" in the code below. I want y2 and y3 to be there when i is 1, y1 and y3 to be there when i is 2 and y1 and y2 to be there when i is 3. I'm sure it's to do with what format the data should be in and I've tried alldata[,-i], but it fits all the columns of alldata except i rather than each column one at a time. I've tri...
2013 Jan 03
3
How to plot multiple datasets
Good Morning, I have 3 sets of data, all with the same horizontal axis but with varying vertical input. I want to plot all 3 sets on one x-y plot. I can get 3 linear regression plots and 3 polynomial regression plots on the same chart but I have not been able to get more than one set of input data on the same chart. Can you help me? Thank you for all that you do to provide R to the public.
2013 Apr 22
0
Copula fitMdvc:
...of km parameter and when I try to run it it say that the length of my initial values is not the same as the parameter. Can somebody guide me where my mistake is. Thanks, Elisa. ################################# #### OLS ESTIMATION fit1 <- lm(Y1 ~ Xi) fit2 <- lm(Y2 ~ Xi) fit3 <- lm(Y3~ Xi) resid1 <- Y1-as.matrix(cbind( 1,Xi))%*%fit1$coef resid2 <- Y2-as.matrix(cbind( 1,Xi))%*%fit2$coef resid3 <- Y3-as.matrix(cbind( 1,Xi))%*%fit3$coef sigma1<-sum(resid1*resid1)/nrow(Xi) sigma2<-sum(resid2*resid2)/nrow(Xi) sigma3<-sum(resid3*resid3)/nrow(Xi) rho12<- cor(resid1...
2004 Feb 26
2
Structural Equation Model
Hello all! I want to estimate parameters in a MIMIC model. I have one latent variable (ksi), four reflexive indicators (y1, y2, y3 and y4) and four formative indicators (x1, x2, x3, x4). Is there a way to do it in R? I know there is the SEM library, but it seems not to be possible to specify formative indicators, that is, observed exogenous variables which causes the latent variable. Thanks, Marcos
2007 Dec 02
3
Help with a Loop
...# do same for the next participant X2=Day[Participant=="2"] Y2=DrugLevel[Participant=="2"] Coeffs=function(X2,Y2) { lmfirst=lm(Y2~X2) lmfirst$coefficients } Coeffs(X2,Y2) # output slope and intercept here # do same for the next participant X3=Day[Participant=="3"] Y3=DrugLevel[Participant=="3"] Coeffs=function(X3,Y3) { lmfirst=lm(Y3~X3) lmfirst$coefficients } Coeffs(X3,Y3) # output slope and intercept here # do same for the next participant # etc for the rest of the participants # any ideas? # thanks -- View this message in context: http://w...
2007 Dec 06
2
How can I plot this graph
Hi, I am having trouble plotting the graph I need given the follow kind of data > xxx <- data.frame( "x"=c(1,2,3,4,5), "y1"=c(2,4,3,5,6), "y2"=c(3,4,6,3,1), "y3"=c(1,3,5,7,3), "z1"=c(1,NA,3,5,NA), "z2"=c(2,NA,4,6,NA) ) > xxx x y1 y2 y3 z1 z2 1 1 2 3 1 1 2 2 2 4 4 3 NA NA 3 3 3 6 5 3 4 4 4 5 3 7 5 6 5 5 6 1 3 NA NA What I need is the following - One graph - y1, y2, y3 plotte...