[R] Nested and non-nested factors in a panel using lmer

2013-09-30 Thread Ana Arjona
I am fitting a model with both nested and non-nested factors. I would really appreciate any comments on what is the correct code to fit the model with lmer. The data structure is a bit complicated. My unit of analysis is the village-organization-dyad. The outcome is observed at the level of the

Re: [R] Apply function to do pairwise calculation

2013-09-30 Thread arun
Hi, Not sure if this helps. #example dataset set.seed(24)  mat1<-matrix(sample(1:50,20*20,replace=TRUE),ncol=20)   set.seed(49)  colnames(mat1)<- sample(rep(LETTERS[1:4],5),20)  rownames(mat1)<- colnames(mat1) mat2<-combn(LETTERS[1:4],2) res<- sapply(split(mat2,col(mat2)),function(x){ x1<-mat1[ro

[R] Can I use R for implementing GBI?

2013-09-30 Thread ChungHoon Cho
Hi I'm ChungHoon Cho and graduate student of Yonsei University in south korea. I just wanna know one thing. Can I use R for implementing GBI(Graph-Based Induction)? and is there any sample code for that? I will wait for your response. thank you. [[alternative HTML version delete

Re: [R] [sm.density.compare] scale up y-axis and additional line type

2013-09-30 Thread Jim Lemon
On 10/01/2013 08:17 AM, Xianwen Chen wrote: Dear fellows, The two questions are on sm.density.compare(). I compare kernel density estimates of two arrays of data. I'd like to scale up y-axis so that I can show better the differences in y values. English is not my first language so I'll try to e

Re: [R] Reshape problem

2013-09-30 Thread arun
Hi, May be this helps. dat1<- structure(list(trialnumber = 1:9, Control = c(0L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 0L), HC = c(0L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 1L ), LC = c(1L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 0L), pleasantness = c(3L, 3L, 2L, 2L, 3L, 4L, 3L, 3L, 2L)), .Names = c("trialnumber", "Control", "H

[R] [sm.density.compare] scale up y-axis and additional line type

2013-09-30 Thread Xianwen Chen
Dear fellows, The two questions are on sm.density.compare(). I compare kernel density estimates of two arrays of data. I'd like to scale up y-axis so that I can show better the differences in y values. English is not my first language so I'll try to explain it. I would like to stretch y-axis

Re: [R] multilevel analysis

2013-09-30 Thread srecko joksimovic
Thanks for your comments, David and Bert. The best would be to provide an example. Let's say we have a dataset like this one: IDEmployee Company OU CountViewPortal CountLogin TimeOnTask Performance 1 Company1 Company1.OU1 21 33 627.8 4.3 2 Company1 Company1.OU2 45 54 34.8 2.3 3 Company2 Company1.OU

Re: [R] multilevel analysis

2013-09-30 Thread David Winsemius
On Sep 30, 2013, at 3:22 PM, srecko joksimovic wrote: > I thought so, but then I found this: > "Normality > The assumption of normality states that the error terms at every level of the > model are normally distributed" > maybe I misinterpreted something. Notice that it is the _error_terms_ th

Re: [R] multilevel analysis

2013-09-30 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of srecko joksimovic > Sent: Monday, September 30, 2013 3:22 PM > To: David Winsemius > Cc: R help > Subject: Re: [R] multilevel analysis > > I thought so, but then I found this: >

Re: [R] multilevel analysis

2013-09-30 Thread srecko joksimovic
I thought so, but then I found this: "Normality The assumption of normality states that the error terms at every level of the model are normally distributed" maybe I misinterpreted something. On Mon, Sep 30, 2013 at 3:06 PM, David Winsemius wrote: > > On Sep 30, 2013, at 2:50 PM, srecko joksim

Re: [R] multilevel analysis

2013-09-30 Thread David Winsemius
On Sep 30, 2013, at 2:50 PM, srecko joksimovic wrote: > I have an example of multilevel analysis with 3 levels, but data are > non-normally distributed. In case of normal distribution, I would perform > multilevel linear analysis using lme function, but what should I do in case > of non-normal di

Re: [R] FW: Library update from version

2013-09-30 Thread Steve Lianoglou
Hi, On Mon, Sep 30, 2013 at 12:44 PM, Ista Zahn wrote: > On Mon, Sep 30, 2013 at 2:49 PM, Steve Lianoglou > wrote: >> Hi, >> >> On Mon, Sep 30, 2013 at 11:12 AM, Cem Girit wrote: >>> Hello, >>> >>> >>> >>> I recently installed version 3.0.1 of R on to a computer. I >>> have a wo

[R] multilevel analysis

2013-09-30 Thread srecko joksimovic
I have an example of multilevel analysis with 3 levels, but data are non-normally distributed. In case of normal distribution, I would perform multilevel linear analysis using lme function, but what should I do in case of non-normal distribution? thanks, Srecko [[alternative HTML version

Re: [R] Apply function to do pairwise calculation

2013-09-30 Thread Adams, Jean
Amanda, If I understand what you're trying to do, this example might help you. M <- structure(c(0.66, 0.05, -0.93, -0.61, 0.65, -0.25, 0.23, -0.89, 0.37, 0.38, -0.91, 0.91, -0.05, -0.65, -0.94, 0.73, -0.88, 0.25, 0.04, -0.89, -0.47, -0.46, 0.86, -0.29, 0.92, 0.22, 0.77, -0.98, -0.56, 0.11, 0.35

Re: [R] barplot - easy for experienced, difficult for me

2013-09-30 Thread Adams, Jean
Look at the example for grouped bar plots here, http://www.statmethods.net/graphs/bar.html Jean On Mon, Sep 30, 2013 at 8:05 AM, happyR wrote: > hey guys, > > I wanna make a simple barplot, looking like this excel graph: >

Re: [R] ks.test or other Kolmogorov-Smirnov code

2013-09-30 Thread sitterlyb
sweet, I didn't know ecdf could be use like that! Thanks! -- View this message in context: http://r.789695.n4.nabble.com/ks-test-or-other-Kolmogorov-Smirnov-code-tp4677290p4677306.html Sent from the R help mailing list archive at Nabble.com. __ R-he

Re: [R] FW: Library update from version

2013-09-30 Thread Ista Zahn
On Mon, Sep 30, 2013 at 2:49 PM, Steve Lianoglou wrote: > Hi, > > On Mon, Sep 30, 2013 at 11:12 AM, Cem Girit wrote: >> Hello, >> >> >> >> I recently installed version 3.0.1 of R on to a computer. I >> have a working installation for a Statconn application using R version >> 2.15.

Re: [R] FW: Library update from version

2013-09-30 Thread Dennis Murphy
In this case the OP probably does need to reinstall contributed packages since going from 2.15.x to 3.0.y entails a major version change in R. Dennis On Mon, Sep 30, 2013 at 11:49 AM, Steve Lianoglou wrote: > Hi, > > On Mon, Sep 30, 2013 at 11:12 AM, Cem Girit wrote: >> Hello, >> >> >> >>

Re: [R] get mouse position without waiting for a click

2013-09-30 Thread Stanislav Aggerwal
thanks Greg Bill On Monday, September 30, 2013, Greg Snow <538...@gmail.com> wrote: > Some code that you can look at for examples of capturing the mouse > position without clicking include the playSudoku function in the sudoku > package and several functions in the TeachingDemos package including

Re: [R] ks.test or other Kolmogorov-Smirnov code

2013-09-30 Thread William Dunlap
> If the ecdf is to be read as y=Pr(x does D occur? The definition is Pr(x <= x_i), but that doesn't matter much here. You know the maximum occurs at one of the points in union(x, y) so you can find it by comparing the ecdf's at each of those points: f <- function(x, y) { xy <- unio

Re: [R] get mouse position without waiting for a click

2013-09-30 Thread Stanislav Aggerwal
Very good question -- sorry to have left that info out of my posting. windows() Thanks for any help. Bill On Mon, Sep 30, 2013 at 4:46 PM, Bert Gunter wrote: > On Windows or X11, (others ???) > > ?getGraphicsEvent > > Cheers, > Bert > > On Mon, Sep 30, 2013 at 7:46 AM, Stanislav Aggerwal >

[R] ks.test or other Kolmogorov-Smirnov code

2013-09-30 Thread sitterlyb
Can any of the tools available provide where the supremum happens? So classically D = sup|F1 - F2| or something to that affect, and then we use D to figure out significance. If the ecdf is to be read as y=Pr(xhttp://r.789695.n4.nabble.com/ks-test-or-other-Kolmogorov-Smirnov-code-tp4677290.html

Re: [R] FW: Library update from version

2013-09-30 Thread Steve Lianoglou
Hi, On Mon, Sep 30, 2013 at 11:12 AM, Cem Girit wrote: > Hello, > > > > I recently installed version 3.0.1 of R on to a computer. I > have a working installation for a Statconn application using R version > 2.15.0 on another computer. I have many libraries under this old > install

Re: [R] get mouse position without waiting for a click

2013-09-30 Thread Greg Snow
Some code that you can look at for examples of capturing the mouse position without clicking include the playSudoku function in the sudoku package and several functions in the TeachingDemos package including HWidentify, HTKidentify, dynIdentify, and TkIdentify. On Mon, Sep 30, 2013 at 8:46 AM, St

[R] FW: Library update from version

2013-09-30 Thread Cem Girit
Hello, I recently installed version 3.0.1 of R on to a computer. I have a working installation for a Statconn application using R version 2.15.0 on another computer. I have many libraries under this old installation. Can I just copy them into the new library from the old, or do

Re: [R] Interperting results of glmnet and coxph plot, Brier score and Harrel's C-Index - am I doing something wrong ???

2013-09-30 Thread David Winsemius
On Sep 29, 2013, at 2:16 PM, E Joffe wrote: > HI, > > Thank you for your answer. > There were 301 events out of 394 observations. > > Study goals: Identify proteins with prognostic power in patients with AML. > There were 232 proteins studied. > Traditional models won't converge. > I wanted to

Re: [R] climstats

2013-09-30 Thread David Winsemius
On Sep 30, 2013, at 3:25 AM, Jenny Williams wrote: > I have been trying to download the climstats package: > https://r-forge.r-project.org/R/?group_id=861 > > but it doesn't seem to run on R 3.0.2 or 3.0.1 What makes you say this? What errors are reprorted? ("Doesn't seems to run" is a bit vag

Re: [R] change specific factor level values to NA in data frame

2013-09-30 Thread Bert Gunter
Well, maybe or maybe not. The problem is that the old factor levels remain. Here's a tiny example that illustrates the issue: > z <- factor(c("a","b","c")) > z[as.character(z)=="c"] <- NA > z [1] ab Levels: a b c Whether or how you wish to change this depends on what you are doing with t

Re: [R] Residuals in garch (tseries)

2013-09-30 Thread Rui Barradas
Hello, To know how something in R is computed, download the sources and read the respective function code. That's one of the benefits of open source software, you can know exactly what is going on. Hope this helps, Rui Barradas Em 30-09-2013 10:31, ZuckerRahmen escreveu: Hello, i'm curre

Re: [R] change specific factor level values to NA in data frame

2013-09-30 Thread Rui Barradas
Hello, A possibility is the following. icol <- sapply(df, is.factor) df[icol] <- lapply(df[icol], function(x){ x[as.character(x) %in% c('Not applicable', 'Invalid', 'Missing')] <- NA x}) Hope this helps, Rui Barradas Em 30-09-2013 10:42, Daniel Caro escreveu: Dear R-users

Re: [R] DEoptim inconsistent output

2013-09-30 Thread Suzen, Mehmet
On 29 September 2013 19:17, Aya Anas wrote: > doesn't make sense at all. I got parameters that don't satisfy the > constraint. In addition, when i substituted with the resulting parameters Maybe you have issues with your interpretation of the usage of the package and expected output. So, Can you

Re: [R] how to compare two different models with different dependent variables

2013-09-30 Thread Bert Gunter
1. This is an r-help list, not a statistics or econometrics list. So you need to post elsewhere. 2. However, having said that, you might find that the CRAN Econometrics task view may be useful. http://cran.r-project.org/web/views/Econometrics.html Cheers, Bert On Mon, Sep 30, 2013 at 4:13 AM, sa

Re: [R] get mouse position without waiting for a click

2013-09-30 Thread Bert Gunter
On Windows or X11, (others ???) ?getGraphicsEvent Cheers, Bert On Mon, Sep 30, 2013 at 7:46 AM, Stanislav Aggerwal wrote: > Consider the following: > > par(mar=c(0,0,0,0),xaxs = 'i',yaxs='i') > plot.new() > for(i in 1:20) > { > z <- matrix(runif(256*256), ncol=256) > dev.hold() > image(

[R] how to compare two different models with different dependent variables

2013-09-30 Thread saira khalid
i want to compare two exchange rate models namely balassa samuelson model n monetary model of exchange rate.but i don't know how??because both models are different n dependent variables are also different from each other...plz help me in my research work n tell me which econometric technique is use

[R] Split type in the RandomForest package

2013-09-30 Thread Cheng, Chuan
Hi guys, I'm new to Random Forest package and I'd like to know what type of split is used in the package for classification? Or can I configure the package to use different split type (like simple split alongside single attribute axis or linear split based on several attributes etc..) Thanks a

[R] get mouse position without waiting for a click

2013-09-30 Thread Stanislav Aggerwal
Consider the following: par(mar=c(0,0,0,0),xaxs = 'i',yaxs='i') plot.new() for(i in 1:20) { z <- matrix(runif(256*256), ncol=256) dev.hold() image(z, col=grey(0:255/255),zlim=c(0,1),useRaster=TRUE) dev.flush() Sys.sleep(.1) } I would like to continuously display the animation until

[R] barplot - easy for experienced, difficult for me

2013-09-30 Thread happyR
hey guys, I wanna make a simple barplot, looking like this excel graph: my data set includes 9 groups of invertebrates (x-axes) and total number (y-axes) from two different parks (1 and 2). my data-set looks like that:

[R] change specific factor level values to NA in data frame

2013-09-30 Thread Daniel Caro
Dear R-users I am trying to replace specific factor level values in a data frame with NAs. The data frame includes different kind of variables (e.g, characters, numbers, and factors). I'd like to replace all 'Not applicable', 'Invalid', 'and Missing' for NA. For example: f.level <- c('Yes', 'No'

[R] Residuals in garch (tseries)

2013-09-30 Thread ZuckerRahmen
Hello, i'm currently working with the 'garch' function provided by the 'tseries' package in R. If you want to fit a time series you can call the function this way fit = garch(data, order=c(1,1)). A GARCH model delivers you a vector of sd's sigma and therefore confidence intervals for your data.

[R] Apply function to do pairwise calculation

2013-09-30 Thread Amanda Li
Hello, I want to do pairwise calculation, but I am not sure how to do so. i.e. I have a correlation matrix M 200*200. Namely colnames(M)=rownames(M). In addition, colnames(M) is one of A, B, C, D. I want to first sort the matrix M into 16 modules according to colnames and rownames, and then apply

Re: [R] Interperting results of glmnet and coxph plot, Brier score and Harrel's C-Index - am I doing something wrong ???

2013-09-30 Thread Terry Therneau
To elaborate on Frank's response, the analysis plan of 1. Look at the data and select "important" variables 2. Put that truncated list into your favorite statistic procedure 3. Ask - are the p-values (c-statistic, coefficients, .) reliable? is a very old plan. The answer to the last qu

Re: [R] str_count counts the substring

2013-09-30 Thread arun
Hi, May be this helps: str1<- "Brazil is the world's leading orange producer, with an output almost as high as that of the next three countries combined (the United States, India, and China). Orange groves are located mainly in the state of São Paulo, in the southeastern region of Brazil. Orang

Re: [R] barplot to the right side

2013-09-30 Thread Jim Lemon
On 09/30/2013 07:47 PM, Juan Andres Hernandez wrote: Hi, does anybody know how to get a barplot with the x axis starting in the right side and the y axis in the right side too? An example: dat=c(2,4,0,6,5) names(dat)=paste('dpt.',1:5,sep='') barplot(dat, horiz=T) box() I need this barplot in mi

[R] climstats

2013-09-30 Thread Jenny Williams
I have been trying to download the climstats package: https://r-forge.r-project.org/R/?group_id=861 but it doesn't seem to run on R 3.0.2 or 3.0.1 and the zipfile is empty. Does anyone know the status of this package or where I can download it. Thanks ** Jenny Williams Spatial I

[R] barplot to the right side

2013-09-30 Thread Juan Andres Hernandez
Hi, does anybody know how to get a barplot with the x axis starting in the right side and the y axis in the right side too? An example: dat=c(2,4,0,6,5) names(dat)=paste('dpt.',1:5,sep='') barplot(dat, horiz=T) box() I need this barplot in mirror, with the zero value to 6 starting in the right si

Re: [R] Understanding classes in R

2013-09-30 Thread David Winsemius
On Sep 29, 2013, at 5:28 PM, Ista Zahn wrote: > Hi JD, > > On Sun, Sep 29, 2013 at 5:48 PM, john doe wrote: >> I am having trouble understanding how classes in R work. Here is a small >> reproducable example: >> >>> x=1 >>> class(x) >> [1] "numeric" >> >> OK. When a variable is a number, it