search for: y1

Displaying 20 results from an estimated 1499 matches for "y1".

2009 Mar 09
2
path analysis (misspecification?)
hi, I have following data and code; cov <- c (1.670028 ,-1.197685 ,-2.931445,-1.197685,1.765646,3.883839,-2.931445,3.883839,12.050816) cov.matrix <- matrix(cov, 3, 3, dimnames=list(c("y1","x1","x2"), c("y1","x1","x2"))) path.model <- specify.model() x1 -> y1, x1-y1 x2 <-> x1, x2-x1 x2 <-> x2, x2-x2 x1 <-> x1, x1-x1 y1 <-> y1, y1-y1 x2 -> y1, x2-y1 summary(sem(path.model,...
2013 Mar 29
3
if clause in data frame
Hi, final<-data.frame() ?? for (m1 in 4:10) { ?????? for (n1 in 4:10){? ?????????? for (x1 in 0: m1) { ????????????? for (y1 in 0: n1) { final<- rbind(final,c(m1,n1,x1,y1)) res}}}} ?final1<-within(final,{flag<-ifelse(x1/m1>y1/n1, 1,0)}) ?head(final1) #? m1 n1 x1 y1 flag #1? 4? 4? 0? 0??? 0 #2? 4? 4? 0? 1??? 0 #3? 4? 4? 0? 2??? 0 #4? 4? 4? 0? 3??? 0 #5? 4? 4? 0? 4??? 0 #6? 4? 4? 1? 0??? 1 Also, just by look...
2013 Mar 17
3
help with simple function
hello all I am writing a quite simple script to study dental wear patterns in humans and I wrote this function sqrt(var(Y1)+var(Y2))^2-4(var(Y1)*(var(Y2)-cov(Y1,Y2)^2)) but appear this error message Error: attempt to apply non-function alternatively I wrote this sqrt(var(Y1)+var(Y2)^2)-4[(var(Y1)*(var(Y2)-cov(Y1,Y2)^2))] but this error message appear [1] NA Warning message: NAs introduced by coercion some suggest...
2007 Aug 05
1
Understanding of Johansen test.
...vector of n variables. It is said that "if the variables in system are all co-integrated, then Rank of A[0] will be different from zero" My understanding is following : suppose, y[t] is of order 3 and p = 1 Then Delta y[t] = A[0]*y[t-1] + epsilon[t] Hence : Delta y1[t] = a[11]*y1[t-1] + a[12]*y1[t-1] +a[13]*y1[t-1] + epsilon1[t] Delta y2[t] = a[12]*y1[t-1] + a[22]*y1[t-1] +a[23]*y1[t-1] + epsilon2[t] Delta y3[t] = a[31]*y1[t-1] + a[32]*y1[t-1] +a[33]*y1[t-1] + epsilon3[t] But is rank of A[0] is 0 then it is possible to find no...
2013 Sep 05
2
binary symmetric matrix combination
Hi, May be this helps: m1<- as.matrix(read.table(text=" y1 g24 y1 0 1 g24 1 0 ",sep="",header=TRUE)) m2<-as.matrix(read.table(text="y1 c1 c2 l17 ?y1 0 1 1 1 ?c1 1 0 1 1 ?c2 1 1 0 1 ?l17 1 1 1 0",sep="",header=TRUE)) m3<- as.matrix(read.table(text="y1 h4??? s2???? s30 ?y1 0 1 1 1 ?h4 1 0 1 1 ?s2 1 1 0 1 ?s30 1...
2009 Jun 19
1
Drawing dendrogram
...TRUE) myclust<- hclust(dist(cor(x), method='euclidian'), method="ave") mydend<-as.dendrogram(myclust) par(mfrow=c(1,2), mar=c(5,4,4,3), oma=c(1, 3, 1, 3)) plot(mydend, xlim=c(4, -0.2), horiz = TRUE, main="My Dendrogram 1") x0<- -0.35 y0<- 0.5 x1<- 1.8 y1<- 0.5 segments(x0, y0, x1, y1, col="red", lty=2) x0<- -0.35 y0<- 4.4 x1<- 1.8 y1<- 4.4 segments(x0, y0, x1, y1, col="red", lty=2) x0<- -0.35 y0<- 0.5 x1<- -0.35 y1<- 4.4 segments(x0, y0, x1, y1, col="red", lty=2) x0<- 1.8 y0<- 0.5 x1...
2013 Apr 08
3
Reshaping a table
Hello all, I have data in the form of a table: X Y1 Y2 0.1 3 2 0.2 2 1 And I would like to transform in the form: X Y 0.1 Y1 0.1 Y1 0.1 Y1 0.1 Y2 0.1 Y2 0.2 Y1 0.2 Y1 0.2 Y2 Any ideas how? Thanks in advance, IOanna [[alternative HTML version deleted]]
2008 Jan 29
3
How to get two y-axises in a bar plot?
Hi, I have measured two response variables (y1, y2) at each treatment level (x = 0, 1.5 or 3). Now I would like to show the y1 and y2 against x in a bar plot. However, y1 and y2 differ in scale so I need two y-axises, one on the left side and one on the right side (and I dont want to standardize my responses). This is fairly easy if you wan...
2008 Feb 27
4
plot y1 and y2 on one graph
Dear all I have a code like x<-1:10 y1<-x+runif(10)*2 y2<-seq(0,50,length.out=10)+rnorm(10)*10 par(mfrow=c(1,2)) plot(y1~x) plot(y2~x) Now I would like to plot y1 and y2 on the same graph, with its two scales (y1 on left and y2 on rigth side). Any help are welcome. Kind regards Miltinho Brazil [[alternative HTML version de...
2008 Apr 09
0
Endogenous variables in ordinal logistic (or probit) regression
A student brought this question to me and I can't find any articles or examples that are directly on point. Suppose there are 2 ordinal logistic regression models, and one wants to set them into a simultaneous equation framework. Y1 might be a 4 category scale about how much the respondent likes the American Flag and Y2 might be how much the respondent likes the Republican Party in America. By the usual simultaneous equation argument, one should not simply run 2 polr polr (Y1 ~ Y2 + X1 +X2) and polr(Y2 ~ Y1 + X1 + X2) bec...
2010 Feb 19
6
retrieve from function
Hi, say I got the function: > x=function(nbr){y<-rnorm(nbr);y1 <- mean(y);plot(y)} how can I retrieve value of y1, when I need it. I don't want: > x=function(nbr){y<-rnorm(nbr);y1 <<- mean(y);plot(y)} > y1 I want someting like: "x$y1" and then I get the value Many thanks, robert -- View this message in context: http:/...
2006 Aug 16
2
adding multiple fitted curves to xyplot graph
Hello RHelpers, This may already have been answered, but despite days of scouring through the archives I haven't found it. My goal is to add multiple fitted curves to a plot. An example data set (a data frame named df in following code) is: x1 y1 factor1 4 1298.25 0.00000000 1 5 1393.25 0.00000000 1 6 1471.50 0.04597701 1 7 1586.70 2.56908046 1 8 1692.10 11.14080460 1 9 1832.55 45.50459770 1 10 1928.30...
2003 Mar 04
4
writing several command line in R console
...hout breaking the continuity of my code more clearly : if for example I write a function, so far i have to write the all code inside on the same line wich may become obscure as the function is more and more complex. I would like to do like in the example of the manuels: >twosam <- function(y1, y2) { n1 <- length(y1); n2 <- length(y2) yb1 <- mean(y1); yb2 <- mean(y2) s1 <- var(y1); s2 <- var(y2) s <- ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2) tst <- (yb1 - yb2)/sqrt(s2*(1/n1 + 1/n2)) tst } all I can do is something like that: >twosam &...
2009 Nov 13
2
why the same values cannot be judged to be the same in R
...;x","y","date") data2<-matrix(data=c(1,1.22,1.32,1, 1.53, 2.34,1, 1.21, 1.37,1, 1.52, 2.35,2, 0.21, 3.33,2, 0.23, 3.35,3, 1.57, 1.31,3, 1.59, 1.33),nrow=8,ncol=3,byrow=TRUE) data2<-data.frame(data2);names(data2)<-c("areaid","x1","y1") data2$tag<-0 data1_1<-data1[1,] data2_1<-data2[data2$areaid==data1_1$areaid & data2$tag==0,] ran_1<-sample(c(1:length(data2_1)),2, replace = FALSE) data2_1<-data2_1[ran_1,] data_1<-merge(data1_1,data2_1) #data_1 # areaid x y date x1 y1 tag # 1...
2006 Feb 17
2
creating 3-way tables for mantelhaen.test
Hi R users I have serveral binary variables (e.g., X1, X2, X3, X4, X5, X,6, and X7) and one continuous variable (e.g., Y1). I combined these variables using data.frame() mydata <- data.frame(X1,X2,X3,X4,X5,X6,X7,Y1) after that, I sorted this data.frame rank.by.Y1<-order(mydata[,8]) sorted.mydata<-mydata[rank.by.Y1,] after that, I replaced Y1's values with values ranging from 1 to 10 ( 1 represents t...
2010 Feb 11
2
Find each time a value changes
Dear List, I am trying to find each time a value changes in a dataset. The numbers are variables for day vs. night values, so what I am really getting is the daily sunrise and sunset. A simplified example is the following: x<-seq(1:100) y1<-rep(1,10) y2<-rep(2,10) y<-c(y1,y2,y1,y1,y1,y2,y1,y2,y1,y2) xy<-cbind(x,y) I would like to know each time the numbers change. Correct answer should be: x=1,11,21,51,61,71,81,91 I would appreciate any help or suggestions. It seems like it should be simple but I?m stuck! Thanks, Ti...
2010 Oct 17
1
lattice xyplot - formatting of multiple Y variables when using subgroups
Hi all, Using xyplot I want to print to Y variables (y1, y2) versus X, conditional on the group. How can I obtain a line (type="l") for one relationship (ie. y1 ~ x) and points (type="p") for the other (y2 ~ x) ? library(lattice) # create some sample data df<-data.frame(group=as.factor(c(rep("a",4), rep("b",4...
2007 Jan 30
2
Rbind for appending zoo objects
Hi R, y1 <- zoo(matrix(1:10, ncol = 2), 1:5) colnames(y1)=c("a","b") y2 <- zoo(matrix(rnorm(10), ncol = 2), 6:10) colnames(y2)=c("b","a") > y1 a b 1 1 6 2 2 7 3 3 8 4 4 9 5 5 10 > y2 b a 6 0.9070204 0.35276...
2011 Nov 24
2
proper work-flow with 'formula' objects and lm()
Dear all I have a work-flow issue with lm(). When I use > lm(y1~x1, anscombe) Call: lm(formula = y1 ~ x1, data = anscombe) Coefficients: (Intercept) x1 3.0001 0.5001 I get as expected the formula, "y1 ~ x1", in the print()ed results or summary(). However, if I pass through a formula object > (form <- formula(y1~x1)) y1 ~...
2009 Mar 09
1
[sem package] path.diagram() ignores the edge.label argument ..?
...an argument to path.diagram() but it's just ignored. can anyone help me on that? p.s.; here is the actual code; cov <- c (1.670028 ,-1.197685 ,-2.931445,-1.197685,1.765646,3.883839,-2.931445,3.883839,12.050816) cov.matrix <- matrix(cov, 3, 3, dimnames=list(c("y1","x1","x2"), c("y1","x1","x2"))) path.model <- specify.model() x1 -> y1, x1-y1 x2 <-> x1, x2-x1 x2 <-> x2, x2-x2 x1 <-> x1, x1-x1 y1 <-> y1, y1-y1 x2 -> y1, x2-y1 summary(sem(path.model,...