similar to: plot mixed variables

Displaying 20 results from an estimated 8000 matches similar to: "plot mixed variables"

2011 Nov 15
5
Convert back to lower triangular matrix
Given a vector;> ab = seq(0.5,1, by=0.1)> ab[1] 0.5 0.6 0.7 0.8 0.9 1.0 The euclidean distance between the vector elements is given by the lower triangular matrix > dd1 = dist(ab,"euclidean")> dd1    1   2   3   4   52 0.1                3 0.2 0.1            4 0.3 0.2 0.1        5 0.4 0.3 0.2 0.1    6 0.5 0.4 0.3 0.2 0.1 Convert the lower triangular matrix to a full
2011 Oct 14
3
Split a list
I have a list of dataframes i.e. each list element is a dataframe with three columns and differing number of rows. The third column takes on only two values. I wish to split the list into two sublists based on the value of the third column of the list element.  Second issue with lists as well. I would like to reduce each of the sublist based on the range of the second column, i.e. if the range of
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
2010 Feb 25
2
Rearranging entries in a matrix
I have a matrix, called data. I used the code below to rearrange the data such that the first column remains the same, but the y value falls under either columns 2, 3 or 4, depending on the value of z. If z=1 for example, then the value of y will fall under column 2, if z=2, the value of y falls under column 3, and so on. data x y z [1,] 50 13 1 [2,] 14 8 2 [3,] 3 7 3 [4,] 4 16 1 [5,] 6
2010 Mar 12
2
Handling repeated values differently
mat is a matrix with X and Y values. > mat X Y [1,] 56 20 [2,] 56 21 [3,] 2 50 [4,] 3 46 [5,] 18 77 [6,] 57 12 [7,] 57 36 [8,] 95 45 [9,] 65 23 [10,] 33 25 [11,] 33 98 [12,] 63 96 [13,] 66 75 [14,] 99 54 [15,] 78 65 [16,] 75 69 [17,] 54 68 [18,] 54 67 [19,] 0 22 [20,] 14 74 [21,] 15 52 [22,] 46 10 [23,] 6 20 [24,] 6 30 As you can see, some of the X values repeat. I wish
2011 Nov 15
1
Convert full matrix back to lower triangular matrix
Given a vector;> ab = seq(0.5,1, by=0.1)> ab[1] 0.5 0.6 0.7 0.8 0.9 1.0 The euclidean distance between the vector elements is given by the lower triangular matrix > dd1 = dist(ab,"euclidean")> dd1    1   2   3   4   52 0.1                3 0.2 0.1            4 0.3 0.2 0.1        5 0.4 0.3 0.2 0.1    6 0.5 0.4 0.3 0.2 0.1 Convert the lower triangular matrix to a full
2004 May 30
1
What's wrong with this simple code???
Hi, all I can not figure this out, please have a look and help me out. thank you! Note: this is in SPLUS, not R. I have following code *********************************** modfit<-function(yir,yew, ft) { n<-length(yew) yew<-yew[1:(n-1)] yy<-yir-ft xx<-yew-ft n<-length(xx) xx0<-xx[2:n] yy0 <-yy [2:n] xx1<-xx[1:(n-1)] fit <- garch(yy0~xx0 + xx1+var.in.mean,
2010 Aug 17
3
predict.lm, matrix in formula and newdata
Dear all, I am stumped at what should be a painfully easy task: predicting from an lm object. A toy example would be this: XX <- matrix(runif(8),ncol=2) yy <- runif(4) model <- lm(yy~XX) XX.pred <- data.frame(matrix(runif(6),ncol=2)) colnames(XX.pred) <- c("XX1","XX2") predict(model,newdata=XX.pred) I would have expected the last line to give me the
2010 Mar 05
2
Selecting rows of a matrix based on some condition on the columns
The data set consists of two sets of matrices, as labelled by the columns, T's and C's. > xy x T1 T2 T3 T4 T5 C1 C2 C3 C4 C5 [1,] 50 0.00 0.00 33.75 0.00 0.00 0.00 36.76 0.00 35.26 0.00 [2,] 13 34.41 0.00 0.00 36.64 32.86 34.11 35.80 37.74 0.00 0.00 [3,] 14 35.85 0.00 33.88 36.68 34.88 34.58 0.00 32.75 37.45 0.00 [4,] 33 34.56
2007 May 11
1
model seleciton by leave-one-out cross-validation
Hi, all When I am using mle.cv(wle), I find a interesting problem: I can't do leave-one-out cross-validation with mle.cv(wle). I will illustrate the problem as following: > xx=matrix(rnorm(20*3),ncol=3) > bb=c(1,2,0) > yy=xx%*%bb+rnorm(20,0,0.001)+0 > summary(mle.cv(yy~xx,split=nrow(xx)-1,monte.carlo=2*nrow(xx),verbose=T), num.max=1)[[1]] mle.cv: dimension of the split subsample
2010 Sep 06
1
How to get "mypkg-manual.pdf"
I am building a package say mypkg. Five months ago, when I built the package I got the mypkg manual in pdf format. Today, after making updates, I build the same package, same name, and steps; unfortunately I do not get the manual in pdf format. Rather I get the following message: cd: can't cd to /cygdrive/c/Documents saving output to 'mypkg-manual.pdf' ...Done Could any one
2008 May 19
1
Select certain elements from dataframe
Hello, I have a specific problem, I have a large dataframe, and after clustering I want to select certain colums, the elements of a subcluster. My dataframe looks like this : > colnames(data) [1] "101KF4319097339" "102KF4319101170" "103KF4319047549" "104KF4319046389" [5] "105KF4319013260" "106KF4319025582"
2011 Jan 30
1
Extract subsets of different and unknown lengths from huge dataset
Dear prospective reader, I apologize for posting my problem but I've just no idea how to go on by processing this huge (over 70 MB) dataset. Thank you in advance for any help or comment! I do appreciate it! My textfile contains 1 column of interest (numbers/values only). The overall issue is to extract 'events', starting points of which are defined by at least 24 preceding values
2008 Jul 26
0
gam() of package "mgcv" and anova()
R-users E-mail: r-help@r-project.org Hi! R-users. A simple object as below was created to see how gam() of package "mgcv" and anova() work. function() { library(mgcv) set.seed(12) nd <- 100 xx1 <- runif(nd, min=1, max=10) xx1 <- sort(xx1) yy <- sin(xx1)+rnorm(nd, mean=5, sd=5) data1 <- data.frame(x1=xx1, y=yy) fit1 <- gam(y~s(x1, k=5),
2009 Mar 28
1
Error in R??
Can someone explain why I am getting the following error: in the r code below? Error in solve.default(diag(2) + ((1/currvar) * (XX1 %*% t(XX1)))) : system is computationally singular: reciprocal condition number = 0 In addition: There were 50 or more warnings (use warnings() to see the first 50) The R code is part of a bigger program. ##sample from full conditional
2023 Oct 31
1
weights vs. offset (negative binomial regression)
[Please keep r-help in the cc: list] I don't quite know how to interpret the difference between specifying effort as an offset vs. as weights; I would have to spend more time thinking about it/working through it than I have available at the moment. I don't know that specifying effort as weights is *wrong*, but I don't know that it's right or what it is doing: if I were
2008 Oct 01
0
xpred.rpart() in library(mvpart)
R-users E-mail: r-help@r-project.org Hi! R-users. http://finzi.psych.upenn.edu/R/library/mvpart/html/xpred.rpart.html says: data(car.test.frame) fit <- rpart(Mileage ~ Weight, car.test.frame) xmat <- xpred.rpart(fit) xerr <- (xmat - car.test.frame$Mileage)^2 apply(xerr, 2, sum) # cross-validated error estimate # approx same result as rel. error from printcp(fit) apply(xerr, 2,
2009 Dec 15
1
R CMD check in Vista
I used R CMD check in windows vista, and it gives me the message 'sh' is not recognized as an internal or external command. How do I get around this, your help would be highly appreciated. [[alternative HTML version deleted]]
2009 Apr 28
2
correlation coefficient
Hello, I would like to get a correlation coefficient (R-squared) for my model. I don't know how to calculate it in R. What I've done so far: x<-8.5:32.5 #Vektor x y<-c(NA ,5.88 , 6.95 , 7.2 , 7.66 , 8.02 , 8.44 , 9.06, 9.65, 10.22 , 10.63 ,11.06, 11.37, 11.91 ,12.28, 12.69 ,13.07 , 13.5 , 13.3 ,14.14 , NA , NA , NA , NA , NA) #Vektor y
2011 Nov 17
1
Vectorizing for weighted distance
Hi All, I am trying to convert the following piece of matlab code to R: XX1 = sum(w(:,ones(1,N1)).*X1.*X1,1); #square the elements of X1, weight it and repeat this vector N1 times XX2 = sum(w(:,ones(1,N2)).*X2.*X2,1); #square the elements of X2, weigh and repeat this vector N2 times X1X2 = (w(:,ones(1,N1)).*X1)'*X2; #get the weighted 'covariance'