Displaying 20 results from an estimated 300 matches similar to: "GAM model to reduce PACF of a model"
2011 Jun 21
5
please help for mgcv package
i read a book from WOOD, there's an example which is talking about the
pollutant.
library(gamair)
library(mgcv)
y<-gam(death~s(time,bs="cr",k=200)+s(pm10median,bs="cr")+s(so2median,bs="cr")+s(o3median,bs="cr")+s(tmpd,bs="cr"),data=chicago,family=Possion)
lag.sum<-function(a,10,11)
{n<-length(a)
b<-rep(0,n-11)
for(i in 0:(11-10))
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
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
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
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 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
2003 Apr 02
2
pacf.mts
I am getting the following:
*** Weave Errors ***
Error in driver$runcode(drobj, chunk, chunkopts) :
Error in eval(expr, envir, enclos) : couldn't find function "pacf.mts"
*** Source Errors ***
Error in eval(expr, envir, enclos) : couldn't find function "pacf.mts"
make[1]: *** [checkVignettes] Error 1
I don't really understand the new namespace mechanism,
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',
2006 Apr 27
0
What are the differences between ACF and PACF in time seriesanalysis?
Hello Michael,
see as an online resource:
http://www.statsoft.com/textbook/sttimser.html or get hold on a time
series analysis textbook, like one of the monographies written by
Hamilton; Luetkepohl; Brockwell & Davis; Harvey or Box & Jenkins, to
name but a few.
In a nutshell, PACF 'eliminates' intermediate autocorrelations compared
to ACF, e.g. an AR(1) process will ordinarily
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
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
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
2010 Jul 22
0
Please advise acf and pacf in order to determine order of Arima
I have data as below.Please let me know how the ACF and Pacf used to
determine the order od arima model.
Is there any rules need to be followed to determine order.Please advise
> turkey.price.ts
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2001 1.58 1.75 1.63 1.45 1.56 2.07 1.81 1.74 1.54 1.45 0.57 1.15
2002 1.50 1.66 1.34 1.67 1.81 1.60 1.70 1.87 1.47 1.59 0.74 0.82
2003 Sep 08
2
pacf lags
pacf in devel seems by default to return a different number of lags
than 1.7.1 for $pacf. I don't see any mention of this in the NEWS file,
or any change in the documentation, so I suspect it is and error,
though it may be an undocumented improvement.
(Newbie question: How is the simplest way to display a function like
pacf.default that is not exported from a namespace?)
Paul
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
2009 Jun 22
1
Problem with storing a sequence of lmer() model fit into a list
Dear R-helpers:
May I ask a question related to storing a number of lmer model fit into a
list.
Basically, I have a for-loop (see towards the bottom of this email)
in the loop, I am very sure that the i-th model fit (i.e.,fit_i) is
successfully generated and the character string (i.e., tmp_i) is created
correctly.
The problem stems from the following line in the for-loop
#trouble making line
2000 Jun 20
1
pacf
Dear list,
according to the documentation of acf{ts}
"the partial correlation coefficient is estimated by fitting
autoregressive models of successively higher orders up to lag.max. "
However, R seems to return the Yule-Walker estimates of the PACF by
default. You can check this using c(1:10) as the series: the YW
estimates are 0.7000000 and -0.1527035 for lags 1 and 2 . If the PACF
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=
2010 Feb 11
1
ACF and PACF
Hi helpers,
can you help me in plotting acf and pacf functions in R.
I am using the code
acf(variable name)
but it is not working.
Expecting your reply.
Thanks
--
View this message in context: http://n4.nabble.com/ACF-and-PACF-tp1477149p1477149.html
Sent from the R help mailing list archive at Nabble.com.