[R] Transforming smooth functions of gam using mgcv

2009-02-15 Thread hesicaia
Hi, I have 2 questions, both pertaining to additive mixed models using mgcv(). I have fit several additive mixed models using the mgcv package (v 1.4) in R (v 2.8) modeling log chlorophyll as follows: mod-try(gamm(log(Chl) ~ s(Year,bs=cs) + s(Latitude,Longitude,bs=tp) +

Re: [R] glm problem

2009-02-15 Thread Roger
Thanks for the reply, that was a typo only in the post. as i was trying to remove some 'sensitive names'. In my real work, i made sure that 1) this command runs without problem qdata.glm = glm(X258 ~ ., family = binomial, data = qdata[ sample(dim(qdata)[1], 1000), ] ) 2) these two gave a

[R] How to fit GARCH(1,1) with targeted unconditional variance?

2009-02-15 Thread Ted Young
Hello, I have a univariate data set, and the unconditional variance is 1. I would like to fit a GARCH(1,1) model to the data set with a constraint: \omega (the constant parameter in GARCH(1,1)) is equal to 1-\alpha-\beta. So the unconditional variance can be controled to be \omega

[R] extracting standard errors in glm.nb

2009-02-15 Thread jpl
Hi, How do I extract the standard errors of the coefficients in a glm.nb model? Thanks. -- View this message in context: http://www.nabble.com/extracting-standard-errors-in-glm.nb-tp22019202p22019202.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] glm problem

2009-02-15 Thread Uwe Ligges
Roger wrote: Thanks for the reply, that was a typo only in the post. as i was trying to remove some 'sensitive names'. In my real work, i made sure that 1) this command runs without problem qdata.glm = glm(X258 ~ ., family = binomial, data = qdata[ sample(dim(qdata)[1], 1000), ] ) 2)

Re: [R] Anova and unbalanced designs

2009-02-15 Thread Tal Galili
Dear John - thank you for your detailed answer and help. Your answer encourages me to ask further: by choosing different contrasts, what are the different hypothesis which are being tested? (or put differently - should I prefer contr.sum over contr.poly or contr.helmert, or does this makes no

Re: [R] extracting standard errors in glm.nb

2009-02-15 Thread Dieter Menne
jpl s-jlubben1 at math.unl.edu writes: How do I extract the standard errors of the coefficients in a glm.nb model? library(MASS) quine.nb1 - glm.nb(Days ~ Sex/(Age + Eth*Lrn), data = quine) sumnb1 = summary(quine.nb1) sumnb1 str(sumnb1) # tells you about the anatomy. Check for $coefficients

Re: [R] anova help

2009-02-15 Thread Mike Lawrence
Provide some example data code and someone may be able to help. On Sat, Feb 14, 2009 at 2:46 PM, Joe King j...@joepking.com wrote: Hi all, I am trying to run a two factor anova, but one of the factors is a random factor, now I am also running in SPSS and it seems its dividing by the wrong

[R] How to plot image of contour in percent?

2009-02-15 Thread yk
I have searched this forum with keywords contour and percent, it only give one irrelevent result. My problems is how to plot contour in percent. In my figure, I have use kde2d to generate density of an array with two dimension point. Using image and contour could plot it. But the line contour

[R] PRESS / RMSEP

2009-02-15 Thread Alex Roy
Dear all , I want to do PRESS (prediction error sums of squares) or the residual mean square error of prediction (RMSEP) which will give me value that is valid for 'future predictions of independent data'. I am using different methods for example, Multiple Linear Regression,

[R] Package for Markov (Regime) Switching (ARMA) Models

2009-02-15 Thread Andreas Klein
Hello R-Users Is there a package in R, that handles Markov (Regime) Switching (ARMA) Models for time series modelling and prediction? Thank you very much. Regards, Andreas. __ R-help@r-project.org mailing list

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-15 Thread David Winsemius
On Feb 14, 2009, at 6:48 PM, Jason Rupert wrote: Many thanks to Greg L. Snow and David Winsemius for their responses. First off I can safely say I don't know enough statistics to be dangerous, but hopefully I will get to that point:) Regarding the goal - ultimately I would like to use

Re: [R] How to plot image of contour in percent?

2009-02-15 Thread David Winsemius
On Feb 15, 2009, at 7:55 AM, yk wrote: I have searched this forum with keywords contour and percent, it only give one irrelevent result. My problems is how to plot contour in percent. In my figure, I have use kde2d to generate density of an array with two dimension point. Using image and

Re: [R] Anova and unbalanced designs

2009-02-15 Thread John Fox
Dear Tal, A complete explanation of this issue is too long for an email; I do address it in my Applied Regression Analysis and Generalized Linear Models text. The question seems to come up so frequently that Georges Monette and I are writing a paper on it (and related issues) for the upcoming

Re: [R] extracting standard errors in glm.nb

2009-02-15 Thread jpl
Hi Dieter, I don't see anything in the str(model) output that matches the standard errors of the coefficients given in summary(model). Any other suggestion? Thanks. jpl Dieter Menne wrote: jpl s-jlubben1 at math.unl.edu writes: How do I extract the standard errors of the

[R] Kalman Filter - dlm package

2009-02-15 Thread g.amo
Dear all, I am currently trying to use the dlm package for Kalman filtering. My model is very simple: Y_t = F'_t Theta_t + v_t Theta_t = G_t Theta_t-1 + w_t v_t ~ N(0,V_t) = N(0,V) w_t ~ N(0,W_t) = N(0,W) Y_ t is a univariate time series (1x1) F_t is a vector of factor

Re: [R] extracting standard errors in glm.nb

2009-02-15 Thread David Winsemius
Look more thoroughly? You should see this about 2/3 the way down the output: $ coefficients : num [1:14, 1:4] 3.019 -0.475 -0.709 -0.724 -0.615 ... ..- attr(*, dimnames)=List of 2 .. ..$ : chr [1:14] (Intercept) SexM SexF:AgeF1 SexM:AgeF1 ... .. ..$ : chr [1:4] Estimate Std. Error z

Re: [R] OT: A test with dependent samples.

2009-02-15 Thread Emmanuel Charpentier
Dear List, Catching up with my backlog, I stumbled upon this : On Wed, 11 Feb 2009 10:33:13 +1300, Rolf Turner wrote : I am appealing to the general collective wisdom of this list in respect of a statistics (rather than R) question. This question comes to me from a friend who is a

[R] loading mgcv package

2009-02-15 Thread Veerappa Chetty
Hi ,When I try to load the 'mgcv package, often, but not always, get this error message. What am I doing wrong? I even tried reinstalling a few times. __ This is mgcv 1.4-1.1 Error in runif(1) : .Random.seed is not an integer vector but of type 'list' Error : .onAttach failed in

[R] Fast ave for sorted data?

2009-02-15 Thread Zhou Fang
Hi, This is probably really obvious, by I can't seem to find anything on it. Is there a fast version of ave for when the data is already sorted in terms of the factor, or if the breaks are already known? Basically, I have: X = 0.1, 0.2, 0.32, 0.32, 0.4, 0.56, 0.56, 0.7... Y = 223, 434, 343,

Re: [R] anova help

2009-02-15 Thread Tal Galili
Hi Joe, you might want to have a look at the nlme package with the lme command. Another option is the more advanced lmer package. Lastly, you could have a look at the ?aov command, and notice the option of using the +Error() term (but that would only work for balanced design cases, so I've heard,

[R] MDS with ranking data (and transformation)

2009-02-15 Thread achristoffersen
Dear Sirs and madams :-) I am trying to teach myself multidimensional scaling. To that effect I have collected a survey asking people to rank 10 philosophers and politicians according to their preference. I have collected 61 answers. The data is organized in ten columns and 61 rows. the columns

[R] How to add new corStruct class in lme?

2009-02-15 Thread Yu Jaime Lee
I was trying to fit a linear mixed model with a user specified correlation structure with lme (package nlme). In the book of Pinheiro and Bates (2000), it was mentioned that new corStruct classes can be added, and the corAR1 constructor and methods can serve as templates. But I am just too dumb

Re: [R] adding S3 vs. S4 to a new package

2009-02-15 Thread Rolf Turner
On 13/02/2009, at 5:42 PM, Edna Bell wrote: Dear R Gurus: I'm building a package and am wondering whether to use S3 or S4 methods. Any advice, please? Thanks, See fortune(121)! cheers, Rolf Turner

[R] Porcentual separation

2009-02-15 Thread Jesús Guillermo Andrade
Dear Fellows: Thanks you all for your great help. Without your guidance I'd not have been able to get this far. So this is the current problem: I have a series (dataframe with 1 column and 283 rows, all with numbers (no NA's) that go from 0 to 3 or 4 with up to 14 decimals. They indicate a

[R] mnormt and mvtnorm

2009-02-15 Thread Shh
Hi R user, I came across a question when I played around with mnormt package (mvtnorm as well), could any of you let me know where I made the mistake? Thanks! For instance, with a multivariate normal distribution with known mean and variance (to be simple, I tried the i.i.d case first) u1 -

Re: [R] Fast ave for sorted data?

2009-02-15 Thread Charles C. Berry
On Sun, 15 Feb 2009, Zhou Fang wrote: Hi, This is probably really obvious, by I can't seem to find anything on it. Is there a fast version of ave for when the data is already sorted in terms of the factor, or if the breaks are already known? If all you want are means, you can use rle()

Re: [R] MDS with ranking data (and transformation)

2009-02-15 Thread Charles C. Berry
On Sun, 15 Feb 2009, achristoffersen wrote: Dear Sirs and madams :-) I am trying to teach myself multidimensional scaling. To that effect I have collected a survey asking people to rank 10 philosophers and politicians according to their preference. I have collected 61 answers. The data is

Re: [R] Fast ave for sorted data?

2009-02-15 Thread Zhou Fang
Thanks! That does exactly what I want. (Heck, maybe this should be included as a default sorted alternative to ave.) I was thinking of doing it another way using cumsums, but maybe this method is faster. Zhou __ R-help@r-project.org mailing list

[R] Plot of MaximumLikihoodFunction

2009-02-15 Thread Haidinger
Hey I'm a relative newbie to R my question is: is it possible to plot the MaximumLiklihood function of the parameter estimation of a garch(arch,arma...) model?? Best regards Rainer __ R-help@r-project.org mailing list

Re: [R] anova help

2009-02-15 Thread Joe King
Ok well heres my data, with the second variable (B variable) being the random variable and the other fixed. Although the F values are about half of what SPSS puts out. My code is anova(lm(dependentrandom~typemusic+typemusic*musicselection)) This is just dummy data for a class but I am

Re: [R] Overloading in R

2009-02-15 Thread Martin Morgan
Hi Shrikanth -- SHRIKANTH SHANKAR shrikanth.shan...@gmail.com writes: I have been trying to write a new class that reimplements the vector class. As a test of my overloading I decided to try and and call t.test on two vectors which were objects of my class rather than the default class.

[R] matrix transpose

2009-02-15 Thread Roger
This is supposed to be an easy operation, but R 2.8.1 on Mac OS X gives me a lot trouble. the t() function simply does not work properly. What I mean is it works sometimes but does not work at the most of the time, even with the same matrix. this is an example taken from R help a -

Re: [R] matrix transpose

2009-02-15 Thread Rolf Turner
On 16/02/2009, at 8:36 AM, Roger wrote: This is supposed to be an easy operation, but R 2.8.1 on Mac OS X gives me a lot trouble. the t() function simply does not work properly. What I mean is it works sometimes but does not work at the most of the time, even with the same matrix. this

Re: [R] anova help

2009-02-15 Thread David Winsemius
You probably did not forget to attach the data the first time, either. You, instead, probably did not remember to read the posting guide thoroughly regarding what constitutes an acceptable attachment type. Suggest that you change your mail client settings to transmit plain text and follow

[R] Passing environments: why doesn't this work???

2009-02-15 Thread John Tillinghast
This is a trivial example I set up to see if I could pass an environment and use the variables in it (this is for a function that will be called many times and might need to use a lot of variables that won't be changing, so it seemed more sensible to use an environment). Here's the code:

Re: [R] Passing environments: why doesn't this work???

2009-02-15 Thread Peter Dalgaard
John Tillinghast wrote: This is a trivial example I set up to see if I could pass an environment and use the variables in it (this is for a function that will be called many times and might need to use a lot of variables that won't be changing, so it seemed more sensible to use an environment).

[R] (no subject)

2009-02-15 Thread Vincze Orsolya
Dear all,I had just started to learn R. So my question may sound a bit stupid for you. Is that possible to match and merge two tables in R? I mean I have two tables, in the first I have two columns: RING NUMBER, WEIGHT and CAPTURE DATE, in the second RING NUMBER, SEX and CAPTURE DATE. 1) First I

Re: [R] matrix transpose

2009-02-15 Thread Wacek Kusnierczyk
Roger wrote: This is supposed to be an easy operation, but R 2.8.1 on Mac OS X gives me a lot trouble. the t() function simply does not work properly. What I mean is it works sometimes but does not work at the most of the time, even with the same matrix. this is an example taken from R help

Re: [R] matrix transpose

2009-02-15 Thread Daniel Viar
Here's one way that seems to work: a - matrix(1:30,5,6) # Create a target for the transpose b - matrix(1:(nrow(a)*ncol(a)),ncol(a),nrow(a)) # populate b with the transpose of a for (i in 1:ncol(a)) { b[i,1:(nrow(a))] - a[1:(nrow(a)),i]} # Check: Did it work? all.equal(b,t(a)) I'm sure there's a

Re: [R] matrix transpose

2009-02-15 Thread Wacek Kusnierczyk
Rolf Turner wrote: On 16/02/2009, at 8:36 AM, Roger wrote: This is supposed to be an easy operation, but R 2.8.1 on Mac OS X gives me a lot trouble. the t() function simply does not work properly. What I mean is it works sometimes but does not work at the most of the time, even with the

Re: [R] (no subject)

2009-02-15 Thread Peter Dalgaard
Vincze Orsolya wrote: Dear all,I had just started to learn R. So my question may sound a bit stupid for you. Is that possible to match and merge two tables in R? I mean I have two tables, in the first I have two columns: RING NUMBER, WEIGHT and CAPTURE Err, ... for large values of two? Or is

Re: [R] Passing environments: why doesn't this work???

2009-02-15 Thread Gabor Grothendieck
Note that you can do things like this too: env$x with(env, x^2) Also its possible you are really getting into object oriented programming without realizing it with the your environments being the objects your functions being the methods. In that case check out the proto package which

[R] GLMM, ML, PQL, lmer

2009-02-15 Thread Youyi Fong
Dear R community, I have two questions regarding fitting GLMM using maximum likelihood method. The first one arises from trying repeat an analysis in the Breslow and Clayton 1993 JASA paper. Model 3 of the epileptic dataset has two random effects, one subject specific, and one observation

Re: [R] MDS with ranking data (and transformation)

2009-02-15 Thread achristoffersen
Charles C. Berry wrote: Something like dat - t( apply( your.data, 1 , order ) ) colnames(dat) - paste( 'philosopher', 1:10, sep='_' ) HTH, Hi Chuck - thx - but I have trouble geting further. I think I need rank not sort - but this still doesnet solve my conundrum. I have data like

Re: [R] (no subject)

2009-02-15 Thread Gabor Grothendieck
Also see the sqldf package which lets you do this using SQL within R. http://sqldf.googlecode.com On Sun, Feb 15, 2009 at 3:43 PM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Vincze Orsolya wrote: Dear all,I had just started to learn R. So my question may sound a bit stupid for you. Is

Re: [R] GLMM, ML, PQL, lmer

2009-02-15 Thread Ben Bolker
Youyi Fong yfong at u.washington.edu writes: Dear R community, I have two questions regarding fitting GLMM using maximum likelihood method. The first one arises from trying repeat an analysis in the Breslow and Clayton 1993 JASA paper. Model 3 of the epileptic dataset has two random

[R] feature extraction on time series data

2009-02-15 Thread Roger
Hi, This is a practical question and I am sure there are many statisticians can give me a hand. I have 500 time series data (500 rows), each row contains 100 intervals, i.e., on each row, I have X1, X2, . X100. I am trying to reduce the dimension of this input because the data at the end of

[R] Unadulterated plot

2009-02-15 Thread James Nicolson
To all, Apologies if this question has already been asked but I can't find anything. I can't seem to think of more specific search terms. I want to display/create a file of a pure plot with a specific height and width. I want to utilise every single pixel inside the axes. I do not want to

[R] std error of the covariance matrix of random effects in lme4

2009-02-15 Thread Ron Burns
Are the standard errors of the covariance matrix elements for the random effects in lme4 (lmer) available. That is, R using lme4 function lmer gives me Random effects: Groups NameVariance Std.Dev. Corr id (Intercept) 0.6360.797 time0.155

[R] solve a linear system with argument is a matrix

2009-02-15 Thread 瑋珊謝
Hi everyone, I have a question to solve linear equations with argument is a matrix. For example, X is a q by p matrix satisfies F(X)=A and t(B)%*%X+t(X)%*%B=0, where A and B are known q by p matrices and 0 is p by p matrix with all elements are 0s. And F(.) is a known function of matrix, X.

Re: [R] extracting standard errors in glm.nb

2009-02-15 Thread jpl
Mea culpa. Thanks! jpl David Winsemius wrote: Look more thoroughly? You should see this about 2/3 the way down the output: $ coefficients : num [1:14, 1:4] 3.019 -0.475 -0.709 -0.724 -0.615 ... ..- attr(*, dimnames)=List of 2 .. ..$ : chr [1:14] (Intercept) SexM SexF:AgeF1

[R] How do I Edit Source Code Files On The Mac?

2009-02-15 Thread greggallen
Hello! I'm using Mac OS X 10.4.11 on a G4. I use the R command, straight from a terminal, because the GUI is slower, and I've never liked GUIs anyway. I tried to set up my environment to use the vi editor, but it always tries to save it in wierd things like this: /private/tmp/RtmpWIhhuo/41a7

Re: [R] solve a linear system with argument is a matrix

2009-02-15 Thread andrew
Hi, This looks like a Lyapanov equation. It is used in control theory I think. There might be something if you search in those packages that deal with this. HTH, On Feb 16, 9:25 am, �|珊�x koaihs...@gmail.com wrote: Hi everyone, I have a question to solve linear equations with argument is a

Re: [R] How do I Edit Source Code Files On The Mac?

2009-02-15 Thread Charles C. Berry
On Sun, 15 Feb 2009, greggal...@gmail.com wrote: Hello! I'm using Mac OS X 10.4.11 on a G4. I use the R command, straight from a terminal, because the GUI is slower, and I've never liked GUIs anyway. I tried to set up my environment to use the vi editor, but it always tries to save it in

Re: [R] How to plot image of contour in percent?

2009-02-15 Thread David Winsemius
I was thinking of a more focused search including the terms contour and either r-help or r-project, but not one restricted to GoogleGroups, ,,, more along the lines of: http://www.google.com/search?hl=enrlz=1B3GGGL_enUS278US278q=r-help+quantile+contourstart=20sa=N or...

Re: [R] solve a linear system with argument is a matrix

2009-02-15 Thread Spencer Graves
Depending on F, there may already be software to solve your system. If not, have you considered recasting the problem as minimizing the sum of squares of deviations from solutions? Then you could use 'optim' or 'nlminb' or ... . Spencer Graves andrew wrote: Hi, This looks like a Lyapanov

[R] Comparison of age categories using contrasts

2009-02-15 Thread Patrick Giraudoux
Dear listers, I would like to compare the levels of a factor with 8 age categories (0,10] (10,20] (20,30] (30,40] (40,50] (50,60] (60,70] (70,90] (however, the factor has not been ordered yet). The default in glm is cont.treatment (for unordered factors) and that leads to compare each level

[R] McFadden Pseudo R2 with positive Likelihood??

2009-02-15 Thread knussear
Hi I'm calculating McFaddens pseudo R2 (1- (Lmodel/L0)) for some models, and i ran into a model where the model of interest has a positive likelihood, while the null has a negative. This of course results in odd values. I searched the list, but find no help. Can anyone provide insight? Thanks

Re: [R] I want axes that cross

2009-02-15 Thread Paul Johnson
On Fri, Feb 13, 2009 at 3:14 PM, Marc Schwartz marc_schwa...@comcast.net wrote: on 02/13/2009 02:19 PM Paul Johnson wrote: On Fri, Feb 13, 2009 at 1:51 PM, Marc Schwartz OK, so given all of the above, something like the following should work: set.seed(1233240) x - rnorm(100) z - gl(2,50)

[R] Time series

2009-02-15 Thread miya
Hello everyone. I am trying to plot data from a time series in R and have run across some problems. I was wondering if someone could help. I have data taken every 15 minutes of a list of rankings of 25 titles. I want to plot one of the article's titles's ranks as a time series. I've been trying

[R] Transformation of Variables

2009-02-15 Thread Arup
I have a data frame in R where all the variables are character in nature. kindly let know how I can transform these character variable into say numeric,Categorical,continuous etc.Please provide me with the proper syntax. Thank you in advance. -- View this message in context: