similar to: plot time series / dates (basic)

Displaying 20 results from an estimated 1100 matches similar to: "plot time series / dates (basic)"

2011 Sep 12
2
Automated generation of combinations
Hello,   I'd like to generate automatically all the possible combinations of a set of 8 variables (there are 535, too many to do it by hand). For example:   input: varA, varB, varC output: varA+varB+varC             varA+varB             varA+varC             varB+varC             varA             varB             varC Is there any function that produces this option?   Thank you [[alternative
2008 Mar 16
2
How to loop through all the columns in dataframe
Hi: Can anyone advice me on how to loop and perform a calculation through all the columns. here's my data xd<- c(2.2024,2.4216,1.4672,1.4817,1.4957,1.4431,1.5676) pd<- c(0.017046,0.018504,0.012157,0.012253,0.012348,0.011997,0.012825) td<- c(160524,163565,143973,111956,89677,95269,81558) mydf<-data.frame(xd,pd,td) trans<-t(mydf) trans I have these values that I need to
2007 Dec 07
5
Grouping by interval
Hello, I have a dataframe of say 20 lines with one line per individual. I want to group these 20 individuals by length class (eg. of 5cm) and get the mean value of all the other variables (eg VarA and VarB) for each length class My dataframe is as follow: Length <- 10:30 VarA <- seq(1000,1200,10) VarB <- seq(500,700,10) Data <- cbind(Length,VarA,VarB) And I want to get something
2012 Jan 01
1
How to pass in a list of variables as an argument to a function?
Hello, I have some code that currently works fine and I am endeavoring to convert the major pieces of it into functions. This involves taking "hard coded" names of variables that are used in various places and figuring out how to abstract them out into functions where the arguments (i.e. a list of variables)?can be passed to the parent function and used within that function for various
2011 Aug 03
1
Coefficient names when using lm() with contrasts
Dear R Users, Am using lm() with contrasts as below. If I skip the contrasts() statement, I get the coefficient names to be > names(results$coef) [1] "(Intercept)" "VarAcat" "VarArat" "VarB" which are much more meaningful than ones based on integers. Can anyone tell me how to get R to keep the coefficient names based on the factor levels
2004 Dec 21
3
R code for var-cov matrix given variances and correlations
Dear list members, Where can I find code for computing the p*p variance-covariance matrix given a vector of p variances (ordered varA, varB, ..., varp) and a vector of all possible correlations (ordered corAB, corAC, ..., corp-1,p)? I know that the covariance between 2 variables is equal to the product of their correlation and their standard deviations: corAB * varA^.5 * varB^.5 and so:
2012 Jul 18
1
fitting several lme sistematically
Dear R-list, I have a data set (in the following example called "a") which have: one "subject indicator" variable (called "id") three dependent variables (varD, varE, var F) three independent variables (varA, varB, varC) I want to fit 9 lme models, one per posible combination (DA, DB, DC, EA, EB, EC, FA, FB, FC). In stead of writting the 9 lme models, I want to
2007 Oct 12
2
accessing ylim set by xyplot
Hello, I would like to know if there is a clever way to avoid the problem illustrated below within the xyplot function. x <- seq(1:10) y <- seq(1:10) pr1 <- xyplot(x ~ y) u <- seq(1:12) v <- seq(1:12) pr2 <- xyplot(u ~ v, col = "red", more = FALSE) prts <- list(pr1, pr2) for(i in prts) print(i, more = TRUE) I realize that one possibility is to
2011 Apr 09
1
loop and sapply problem, help need
Dear R experts Sorry for this question M1 <- 1:10 lcd1 <- c(11, 22, 33, 44, 11, 22, 33, 33, 22, 11) lcd2 <- c(22, 11, 44, 11, 33, 11, 22, 22, 11, 22) lcd3 <- c(12, 12, 34, 14, 13, 12, 23, 23, 12, 12) #generating variables through sampling pvec <- c("PR1", "PR2", "PR3", "PR4", "PR5", "PR6", "PR7",
2007 Mar 16
1
multiple scores per subject
Hi, I have a data set that looks like this: > data vara varb S PC 1 None 250 1 80 2 None 250 1 70 3 Some 250 1 60 4 Some 250 1 70 5 None 1000 1 90 6 None 1000 1 90 7 Some 1000 1 80 8 Some 1000 1 70 9 None 250 2 100 10 None 250 2 80 11 Some 250 2 70 12 Some 250 2 70 13 None 1000 2 100 14 None 1000 2 90 15 Some 1000 2 50 16 Some 1000 2 40 ... And so on.
2007 Nov 07
2
creating a dynamic output vector
Let's say I have a program that returns variables whose names may be any string within the vector NAMES=c("varA","varB","varC","varD","varE","varF"..."varZ"), but I do not ever know which ones have actually been created. So in one example output, "varA", "varC", and "varD" could exist, but
2011 Sep 03
2
ROCR package question for evaluating two regression models
Hello All,  I have used logistic regression glm in R and I am evaluating two models both learned with glm but with different predictors. model1 <- glm (Y ~ x4+ x5+ x6+ x7, data = dat, family = binomial(link=logit))model2 <- glm (Y~ x1 + x2 +x3 , data = dat, family = binomial(link=logit))  and I would like to compare these two models based on the prediction that I get from each model: pred1 =
2009 Jan 28
3
initial value in 'vmmin' is not finite
Dear r helpers I run the following code for nested logit and got a message that Error in optim(c(0, 0, 0, 0, 0.1, -2, -0.2), fr, hessian = TRUE, method = "BFGS") : initial value in 'vmmin' is not finite What does this mean? and how can I correct it? Thank you June > yogurt = read.table("yogurtnp.csv", header=F,sep=",")> attach(yogurt)>
2009 Mar 02
1
initial gradient and vmmin not finite
Dear Rhelpers I have the problem with initial values, could you please tell me how to solve it? Thank you June > p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2))) Error in maxRoutine(fn = logLik, grad = grad, hess = hess, start = start, : NA in the initial gradient > p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2),method="BFGS")) Error in optim(start, func, gr =
2010 Sep 15
1
optim with BFGS--what may lead to this, a strange thing happened
Dear R Users on a self-written function for calculating maximum likelihood probability (plz check function code at the bottom of this message), one value, wden, suddenly jump to zero. detail info as following: w[11]=2.14 lnw =2.37 2.90 3.76 ... regw =1.96 1.77 1.82 .... wden=0.182 0.178 0.179... w[11]=2.14 lnw=2.37 2.90 3.76 ... regw =1.96 1.77 1.82 .... wden=0.182
2005 Apr 07
2
newline in lattice axis label
Hi, I have a 3 panel xyplot with different variables in the y axis. I'm trying to insert a newline after "Width (cm)," in the ylab argument as in the example below. My goal is to have the y axis label broken into two lines, split after the string just mentioned. plotfun <- function() { fakedf <- data.frame(A = sample(1:100, 50), B = rnorm(50),
2010 Sep 07
5
question on "optim"
Hey, R users I do not know how to describe my question. I am a new user for R and write the following?code for a dynamic labor economics?model and use OPTIM to get optimizations and parameter values. the following code does not work due to the?equation: ?? wden[,i]<-dnorm((1-regw[,i])/w[5])/w[5] where w[5]?is one of the parameters (together with vector a, b and other elements in vector
2012 Jul 17
2
Problem creation tensor
Hi guys, I need some help to analyzing my data. I start to describe my data: I have 21 matrices, every matrix on the rows has users and on columns has items, in my case films. Element of index (i, j) represent the rating expressed by user i about item j. I have a matrix for each of professions. An example of a this type of matrix is: item 1 item 2 item 3 item4 id
2011 May 05
3
cross-correlation table with subscript or superscript to indicate significant differences
Hi, I wonder whether the following is possible with R, and whether anyone has done that and can share his/her code with me. I have a correlation matrix, and I want to create a correlation table that I can copy to Microsoft Word with a superscript above each correlation, indicating significant differences in the same row. That is, when correlations in the same row do not share superscript, it means
2005 May 03
2
comparing lm(), survreg( ... , dist="gaussian") and survreg( ... , dist="lognormal")
Dear R-Helpers: I have tried everything I can think of and hope not to appear too foolish when my error is pointed out to me. I have some real data (18 points) that look linear on a log-log plot so I used them for a comparison of lm() and survreg. There are no suspensions. survreg.df <- data.frame(Cycles=c(2009000, 577000, 145000, 376000, 37000, 979000, 17420000, 71065000, 46397000,