similar to: Problem with storing a sequence of lmer() model fit into a list

Displaying 20 results from an estimated 130 matches similar to: "Problem with storing a sequence of lmer() model fit into a list"

2011 Dec 17
2
Problem with reproducing log likelihood estimated with ghyp package
I was playing around with the ghyp package and simulated series of t-distributed variables when suddenly i was not able to reproduce the log likelihood values reported by the package. When trying to reproduce the likelihood values, I summed the log(dt(x,v)) values and it worked with some simulated series but not all. Is there any obvious flaws with this script? library("ghyp")
2007 Dec 04
1
Best forecasting methods with Time Series ?
Hello, In order to do a future forecast based on my past Time Series data sets (salespricesproduct1, salespricesproduct2, etc..), I used arima() functions with different parameter combinations which give the smallest AIC. I also used auto.arima() which finds the parameters with the smallest AICs. But unfortuanetly I could not get satisfactory forecast() results, even sometimes catastrophic
2009 Sep 16
3
apply function across two variables by mult factors
Greetings, I am attempting to run a function, which produces a vector and requires two input variables, across two nested factor levels. I can do this using by(X, list(factor1, factor2), function), however I haven't found a simple way to extract the list output into an organized vector form. I can do this using nested loops but it isn't exactly an optimal approach. Thank you
2009 Mar 20
4
how to make aggregation in R ?
Hi, I am trying to aggregate the sum of my test data.frame as follow: testDF <- data.frame(v1 = c("a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "c", "c", "c", "c", "c", "d", "d", "d", "d",
2011 Mar 09
2
SQLDF - Submitting Queries with R Objects as Columns
Fellow R programmers, I'd like to submit SQLDF statements with R objects as column names. For example, I want to assign "X" to "var1" (var1<-"X") and then refer to "var1" in the SQLDF statement. SQLDF needs to understand that when I reference "var1", it should look for "X" in the dataframe. This is necessary because my SQLDF
2010 Sep 18
0
Saving long character variable to database saves timestamp instead
When saving a data frame with long character variable, approximately longer than 30000 characters, to a text field in PostgreSQL, using RODBC on Windows XP, I get a timestamp saved to the database instead. Is there any way to extend the number of characters that a text variable can receive? Here are the details of my case (simplified): I'm using PostgreSQL to create a table CREATE TABLE
2008 Feb 26
1
wrapper for save function
Hello - I would like to create a wrapper to the 'save' function in the base package, but have a small problem with the name of the object that is getting saved in the file. Below is a simple example illustrating my problem. ## BEGIN SAMPLE R CODE ################################################## ## Here is the wrapper for the save function
2007 Nov 09
2
wrapper for coxph with a subset argument
Dear R-help - Thanks to those who replied yesterday (Christos H. and Thomas L.) regarding my question on coxph and model formula, the answers worked perfectly. My new question involves the following. I want to run several coxph models (package survival) with the same dataset, but different subsets of that dataset. I have found a way to do this, described below in functions subwrap1 and
2011 Jan 01
3
Retrieving Factors with Levels Ordered
Hello (and Happy New Year), When I create a factor with labels in the order I want, write the data as a text file, and then retrieve them, the factor levels are no longer in the proper order. Here is what I do (I tried many variations): # educ is a numeric vector with 1,001 observations. # There is one NA # Use educ to create a factor feducord <- factor(educ, labels = c('Elem',
2009 Feb 20
2
Grouped bwplots?
Dear list, I am sorry for asking you this, but I am trying to do again what I thought I have done before, although this time it does not work. So, given the data set: > testdf <- data.frame(grfak=sample(c("One","Two"),size=100,replace=TRUE), panfak= sample(c("Yes","No"),size=100,replace=TRUE), xfak=
2012 Nov 13
0
GAM model to reduce PACF of a model
I have asked this question on Stackoverflow and was told it does not relate to the sites' mission as it is statistical question, thus I brought it here. I am fitting a gam mode in the mgcv package to study associations of environmental pollutants and mortality. The aim is to choose a model with lowest mgcv and also to reduce the PACF to less than < |0.1|. library(gamair) library(mgcv)
2007 Dec 19
1
Different labels by panel in barchart
Dear all, I'm analysing a survey, and creating a barchart of the different responses for each question. The questions are grouped according to a number of categories, so I'm using lattice to create a plot with each question in a category on it. The problem is that the response set for different questions within the same category varies. I want to be able to draw only the relevant
2011 May 17
1
Dealing with null values Aggregate function
Hi R users I trying to some aggregate statistics on a very large dataset. The null values are causing a problem. I would like to calculate aggregate values for groups. I am just no sure how to deal with the "" I would ideally like them to ignored ie if there is only 1 value over several columns than that value would be the summary statistic. I have put the following example together to
2007 Feb 20
1
Difficulties with dataframe filter using elements from an array created using a for loop or seq()
Hi All- This seems like such a pathetic problem to be posting about, but I have no idea why this testcase does not work. I have tried this using R 2.4.1, 2.4.0, 2.3.0, and 2.0.0 on several different computers (Mac OS 10.4.8, Windows XP, Linux). Below the signature, you will find my test case R code. My point in this folly is to take a dataframe of 300,000 rows, create a filter based on two
2008 Apr 03
1
by "infelicity"
Dear list, Please find below an example of odd behaviour of the by function. It occurs both under GNU/Linux R 2.6.2 and Windows R 2.7.0alpha. Respective sessionInfo()'s are given below. I hope I do not overlook anything. testFactor <- factor(sample(LETTERS[1:6], size = 42, replace = TRUE)) testMatrix <- matrix(rnorm(42 * 6), nrow = 42) testDf <- as.data.frame(testMatrix) by(data
2005 Nov 03
4
nlme questions
Dear R users; Ive got two questions concerning nlme library 3.1-65 (running on R 2.2.0 / Win XP Pro). The first one is related to augPred function. Ive been working with a nonlinear mixed model with no problems so far. However, when the parameters of the model are specified in terms of some other covariates, say treatment (i.e. phi1~trt1+trt2, etc) the augPred function give me the following
2013 Oct 07
1
Why read.table replacing space with "." in the header
Hi, Use `check.names=FALSE` head(dd,2) #? Phylo.Tree Genesis.Tree #1????????? 1??????????? 2 #2????????? 2??????????? 3 ?dd <- data.frame("Phylo Tree"= c(1:10), "Genesis Tree"= c(2:11),check.names=FALSE) head(dd,2) #? Phylo Tree Genesis Tree #1????????? 1??????????? 2 #2????????? 2??????????? 3 write.csv(dd,"Crish.csv",row.names=FALSE) ?yy<-
2006 Mar 29
1
calcualtign a trailing 12 column mean in a dataframe?
I have a dataframe of 25 columns and 100,000 rows called ?testdf?. I wish to build a new dataframe, with 14 columns and 100,000 rows. I wish the new dataframe to have the ?trailing 12 column? mean. That is, I want column 1 of the new dataframe to have soemthing like: ?( mean(testdf[,1:12],na.rm=T)? What is the best way to accomplish this?
2010 Jul 19
1
pcaMethods and Lattice help.
I've been using the pcaMethods to develop a scores matrix ======================================= data(iris) pcIr <- pca(iris[,1:4], method="nipals", nPcs=3, cv="q2") test <- scores(pcIr) ======================================== What I'm looking to do is to use lattice's barchart to plot the scores something like below, but expanded to all the scores
2011 Jul 01
4
Access only part of last dimension of table/matrix
I would like to do some operations inside a function using only one value for the last dimension of a table/matrix: tabfn <- function (dfrm, facvec, YN ="event"){ return( Etbl <- do.call(table, dfrm[ , c(facvec, "event") ]) ) # just want Etbl[,,,"TRUE"] or Etbl[,, "TRUE"] or Etbl[,"TRUE"] }