[R] Poisson Lognormal

2010-03-26 Thread Robert Ruser
Hi R Users, I'm going to estimate via. ML the parameters in Poisson Lognormal model. The model is: x | lambda ~ Poisson(lambda) lambda ~ Lognormal(a,b) Unfortunately, I haven't found a useful package allowing for such estimation. I tried to use "poilog" package, but there is no equations and it's

Re: [R] Poisson Lognormal

2010-03-26 Thread Robert Ruser
2010/3/26 Charles C. Berry : > On Fri, 26 Mar 2010, Robert Ruser wrote: > So this is the generalized linear model with a poisson family, log link, and > a Gaussian random effect in the linear predictor. > > Take a look at lme4, MASS (glmmPQL), and try searching CRAN packages for &

Re: [R] Poisson Lognormal

2010-03-28 Thread Robert Ruser
Chuck thank you very much for help. I will follow your advice and see what happen. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] Tinn-R

2010-04-19 Thread Robert Ruser
Hello, I want to use the free distribution of R (R REvolution 3.2) and Tinn-R editor as well. Unfortunately they don't cooperate. In Tinn-R commands: send selection, send line etc. don't work. Do you have any idea how to resolve this problem? Best, Robert _

Re: [R] Tinn-R

2010-04-19 Thread Robert Ruser
(Hebrew) | > www.r-statistics.com (English) > -- > > > > > On Mon, Apr 19, 2010 at 6:50 PM, Robert Ruser > wrote: >> >> Hello, >> I want to use the free distribution of R (R REvolution 3.2) and Tinn-R >> editor as well. Unfortunately they don't cooperate.

[R] different x-axes in Lattice

2010-01-24 Thread Robert Ruser
I use lattice package and 'barchart' to build a chart. I have a problem with setting different x-axes. Some x categories are missing but they are display and I don't want. I use scales = list(y = "free",x="free") but it works only for y-axes. Simple example: package(lattice) barchart(yield ~ varie

[R] compare and replace

2010-11-06 Thread Robert Ruser
Hello R Users, I'm wondering if there exists any elegant and simple way to do the following: I have a data.frame X fills in numbers. I have a vector y with numbers as well. Every value in X that is equal to any values in y should be replaced by e.g. 1. Any idea? Robert ___

Re: [R] compare and replace

2010-11-06 Thread Robert Ruser
Thank you vary much Ben and Erik. It's exactly what I want. Below is my a little modified example. set.seed(12345) X = sample(c(40:60),40,replace=TRUE) x = matrix(X,nc=5) y = c(40,43,55,60) x[x %in% y] <- -1 __ R-help@r-project.org mailing list https://

[R] Breslow-Day test

2010-11-16 Thread Robert Ruser
Dear R Users, I'm looking for a package that allows to test hypothesis about a homogeneity of odds ratio in k 2x2 tables. I know that Breslow-Day is suitable but does anybody could me point out a package? I found diffR, but as far as I see this package is for IRT theory. Best, Robert

[R] assigment

2010-11-19 Thread Robert Ruser
Hello R Users, I have vectors x <- c("a2","b7","c8") y1 <- c(1,2,3,2) y2 <- c(4,2,7,5,4,3,8) y3 <- c(1:10) and I want to assign values form vector y1 to a new variable which name comes from the 1st value of the vector x etc. How to do it using only vector x. As a result I should have: a2 <- y1 b7

Re: [R] assigment

2010-11-19 Thread Robert Ruser
uot;c8") > dat > # example > dat$a2 > dat[["a2"]] > > > ## or using your variables > dat2 <- list(y1, y2, y3) > names(dat2) <- x > > Cheers, > > Josh > > > On Fri, Nov 19, 2010 at 2:57 AM, Robert Ruser wrote: >> Hello R

Re: [R] assigment

2010-11-19 Thread Robert Ruser
Joshua, Dennis ans Henrique I'm immensely indebted to you. Thanks to you I resolved my problem - a code works perfectly. I put the code, maybe someone finds it's helpful. f1 <- readLines(file("file1.txt")) f2 <- readLines(file("file2.txt")) for ( i in seq_along(f1)){ assign(f1[i],as.numeric(unli

[R] save a list as a matrix

2010-11-20 Thread Robert Ruser
Hello, Let's assume that one has a list: my.list <- list(a=c(1,2,3,4),b=4,c=c(1:7)) I want to save my.list as a matrix in .txt file. Because of different length we can put NA or 0. Effect (row.names a, b and c are not necessary) a 1 2 3 4 0 0 0 b 4 0 0 0 0 0 0 c 1 2 3 4 5 6 7 How to do it? Than

Re: [R] save a list as a matrix

2010-11-20 Thread Robert Ruser
Hi Mohamed, It works. Thank you very much. Best, Robert 2010/11/20 : > Hi Robert, > > Try to do this > >  Len <- max(sapply(my.list, length)) > >  fun1 <- lapply(my.list, function(x){ >      c(x, rep(0, Len))[1:Len] >  }) >  do.call(rbind, fun1) > > M > Regards

[R] labels and barchart

2010-12-21 Thread Robert Ruser
Hello, I'm wondering how to set a value of mar ( par( mar=c(...)) ) in order to allow labels to be visible in barplot. Is there any relation between the number of characters in a label and the second value of mar? Look at my example. x <- seq(20, 100, by=15) ety <- rep( "Effect on treatment gr

Re: [R] labels and barchart

2010-12-21 Thread Robert Ruser
2010/12/21 Gerrit Eichner : > par( mar = c( 3, 13, 2, 1), cex = 0.8) > > barplot( x, names.arg = NULL, horiz = TRUE, axes = FALSE) > > axis( side = 1, at = c( seq( 0, 80, by = 20), 95)) > > axis( side = 2, at = 1:length(ety), line = -1, las = 1, tick = FALSE, >      labels = ety) Thank you very mu

Re: [R] labels and barchart

2010-12-21 Thread Robert Ruser
2010/12/21 Dieter Menne : > Standard graphics has fallen a bit out of favor because of these quirks. Try > lattice: > > library(lattice) > x <- seq(20, 100, by=15) > ety <- paste("Effect on treatment group",1:length(x)) > barchart(ety~x) > > Note that the ety labels must be different to make this w

[R] Linear model - coefficients

2011-06-12 Thread Robert Ruser
Dear R Users, Using lm() function with categorical variable R use contrasts. Let assume that I have one X independent variable with 3-levels. Because R estimate only 2 parameters ( e.g. a1, a2) the coef function returns only 2 estimators. Is there any function or trick to get another a3 values. I

Re: [R] Linear model - coefficients

2011-06-12 Thread Robert Ruser
em. Robert 2011/6/12 Prof Brian Ripley : > ?dummy.coef > > (NB: 'R' does as you tell it, and if you ask for the default contrasts you > get coefficients a2 and a3, not a1 and a2.  So perhaps you did something > else and failed to tell us?  And see the comment in ?dumm

Re: [R] Linear model - coefficients

2011-06-12 Thread Robert Ruser
HTH, > Jorge > > On Sun, Jun 12, 2011 at 4:40 PM, Robert Ruser <> wrote: >> >> Prof. Ripley, thank you very much for the answer but wanted to get >> something else. There is an example and an explanation: >> >> options(contrasts=c("contr

Re: [R] Linear model - coefficients

2011-06-12 Thread Robert Ruser
Hi Weidong, thank you very much. It really works fine. Robert 2011/6/12 Weidong Gu : > this may work. > X<-data.frame(sapply(X,function(x) as.factor(x))) > reg3=lm(Y~.,data=X) > dummy.coef(reg3) > > Weidong Gu > > On Sun, Jun 12, 2011 at 4:55 PM, Robert Ruser wrote:

[R] factor analysis - constraints

2011-04-19 Thread Robert Ruser
Dear R Users, I'm wondering how is it possible to get |factor loadings| <1 in factor analysis model (factanal) performing maximum-likelihood estimation. Is it caused by some constraints? If so, what kind of constraints are placed and when (during the estimation or after)? Robert _