Re: [R] Reading a large directory of compressed zips into a data frame

2016-07-09 Thread David Winsemius
> On Jul 9, 2016, at 10:59 PM, Giles Bischoff wrote: > > Hello R Programmers! > I was wondering if y'all could help me. I'm trying to read data from a > directory containing 332 compressed zips all with about 1000 lines (or > more) of data into a data frame. I have it so that the directory is se

[R] Reading a large directory of compressed zips into a data frame

2016-07-09 Thread Giles Bischoff
Hello R Programmers! I was wondering if y'all could help me. I'm trying to read data from a directory containing 332 compressed zips all with about 1000 lines (or more) of data into a data frame. I have it so that the directory is set to the file with the zips in it. I figured this way when I tried

[R] column name changes

2016-07-09 Thread Kristi Glover
Hi R user,  I wanted to change a column name with new one  but it comes with "." where there was space. Is there any way to keep my formate with space? Here what I found  Images<-stack(imageA,imageB,imageC) names(Images)[3]<-c("dif of AB") head(Images) It gives the column name of 3 as a "dif.of.

Re: [R] [FORGED] Regression with factors ?

2016-07-09 Thread Jeff Newmiller
I have seen less sensical questions. It would be nice if the example were a bit more complete (as in it should have excess degrees of freedom and an answer) and less like a homework problem (which are off topic here). It would of course also be helpful if the OP were to conform to the Posting G

Re: [R] R council with regard to the analysis needd

2016-07-09 Thread David Winsemius
> On Jul 9, 2016, at 9:12 AM, Julia Edeleva wrote: > > Dear R community, > > I am a PhD student at the University of Münster writing my thesis in > psycholinguistics. > > I am currently running statistical analysis on a dataset with 3 fixed > factors (syntax, position), each with 2 levels and

Re: [R] [FORGED] Regression with factors ?

2016-07-09 Thread Rolf Turner
On 09/07/16 20:52, stn021 wrote: Hello, I would like to analyse a model like this: y = 1 * ( 1 - ( x1 - x2 ) ^ 2 ) x1 and x2 are not continuous variables but factors, so the observation contain the level. Its numerical value is unknown and is to be estimated with the model. The observati

Re: [R] dependent p.values

2016-07-09 Thread Rolf Turner
On 10/07/16 03:17, Fernando Marmolejo Ramos wrote: hi all does any one know a method to combine dependent p.values? See fortune(269). :-) cheers, Rolf Turner -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276

Re: [R] Fixed Effects in lme function

2016-07-09 Thread Ben Bolker
li li gmail.com> writes: > > Dear all, > For the data below, I would like to fit a model with common > random slope and common random intercept as shown below. I am > interested in obtaining separate fixed effect estimates (intercept > and slope and corresponding hypothesis test) for each

Re: [R] How to make the "apply" faster

2016-07-09 Thread Charles C. Berry
On Sat, 9 Jul 2016, Debasish Pai Mazumder wrote: I have 4-dimension array x(lat,lon,time,var) I am using "apply" to calculate over time new = apply(x,c(1,2,4),FUN=function(y) {length(which(y>=70))}) This is very slow. Is there anyway make it faster? If dim(x)[3] << prod(dim(x)[-3]), new <-

Re: [R] How to make the "apply" faster

2016-07-09 Thread Jeff Newmiller
function(y) {sum(y>=70)} -- Sent from my phone. Please excuse my brevity. On July 9, 2016 1:19:27 PM PDT, Debasish Pai Mazumder wrote: >I have 4-dimension array x(lat,lon,time,var) > >I am using "apply" to calculate over time > new = apply(x,c(1,2,4),FUN=function(y) {length(which(y>=70))}) > >Th

[R] Fwd: How to make the "apply" faster

2016-07-09 Thread Peter Langfelder
Forgot to cc the list... -- Forwarded message -- From: Peter Langfelder Date: Sat, Jul 9, 2016 at 1:32 PM Subject: Re: [R] How to make the "apply" faster To: Debasish Pai Mazumder You could try the following (I haven't tested it so check that the results make sense): indicator

[R] How to make the "apply" faster

2016-07-09 Thread Debasish Pai Mazumder
I have 4-dimension array x(lat,lon,time,var) I am using "apply" to calculate over time new = apply(x,c(1,2,4),FUN=function(y) {length(which(y>=70))}) This is very slow. Is there anyway make it faster? -Debasish [[alternative HTML version deleted]] _

Re: [R] Help with constrained portfolio optimization

2016-07-09 Thread Enrico Schumann
On Fri, 08 Jul 2016, Paulino Levara writes: > Dear R community, > > I am a beginner in portfolio optimization and I would appreciate your help > with the next problem:given a set of 10 variables (X), I would like to > obtain the efficient portfolio that minimize the variance taking the > expected

Re: [R] 'ref' must be an existing level

2016-07-09 Thread William Dunlap via R-help
Adding the argument strip.white=TRUE to your call to read.csv() will remove possible leading or trailing "white space" (spaces and tabs). > str(read.csv( text = " honors,cum laude\nhonors, cum laude\n", header=FALSE)) 'data.frame': 2 obs. of 2 variables: $ V1: Factor w/ 2 levels " honors","hon

[R] dependent p.values

2016-07-09 Thread Fernando Marmolejo Ramos
hi all does any one know a method to combine dependent p.values? best Fernando Marmolejo-Ramos Postdoctoral Fellow G�sta Ekman Laboratory Department of Psychology Stockholm University Frescati Hagv�g 9A, Stockholm 114 19 Sweden ph = +46 08-16 46 07 websit

[R] R council with regard to the analysis needd

2016-07-09 Thread Julia Edeleva
Dear R community, I am a PhD student at the University of Münster writing my thesis in psycholinguistics. I am currently running statistical analysis on a dataset with 3 fixed factors (syntax, position), each with 2 levels and their interaction (syntax*position). The accuracy rate is the dependen

Re: [R] 'ref' must be an existing level

2016-07-09 Thread Michael Dewey
Dear Shivi Just printing it will not tell you. I did not mean 'Have you spelled it correctly?' I meant 'Is there a stray space somewhere?'. Peter has the same suspicion. On 09/07/2016 12:49, Shivi Bhatia wrote: Hi Michael, I did check again and used the print command but it is spelled as ho

Re: [R] 'ref' must be an existing level

2016-07-09 Thread David Winsemius
> On Jul 9, 2016, at 4:32 AM, peter dalgaard wrote: > > Hmm, and levels(m11$prog)? Shivi; See what this returns: "honors" %in% levels(m11$prog) The level is probably something like " honors" It's fairly easy to inadvertently create leading or trailing spaces when reading from comma-separa

[R] Regression with factors ?

2016-07-09 Thread stn021
Hello, I would like to analyse a model like this: y = 1 * ( 1 - ( x1 - x2 ) ^ 2 ) x1 and x2 are not continuous variables but factors, so the observation contain the level. Its numerical value is unknown and is to be estimated with the model. The observations look like this: yx1

Re: [R] r code for multilevel latent class analysis

2016-07-09 Thread Cristina Cametti
Dear all, thank you very much for your suggestions! About the fact that I put my variables plus 1, it is because if I don�t do it, I get this message: ALERT: some manifest variables contain values that are not positive integers. For poLCA to run, please recode categorical outcome variabl

Re: [R] 'ref' must be an existing level

2016-07-09 Thread Michael Dewey
Dear Shivi Are you sure that the level is "honors" and not " honors" or "honors " or something similar? On 09/07/2016 11:50, Shivi Bhatia wrote: Hi Peter, It gives me breakdown of all categories with their respective freq. Diploma general honors 50 45 105 On Sa

Re: [R] 'ref' must be an existing level

2016-07-09 Thread peter dalgaard
Hmm, and levels(m11$prog)? (There's a chance that a space has sneaked in, but your HTML mail makes it hard to see column alignment) -pd > On 09 Jul 2016, at 12:50 , Shivi Bhatia wrote: > > Hi Peter, > It gives me breakdown of all categories with their respective freq. > Diploma general

Re: [R] 'ref' must be an existing level

2016-07-09 Thread Shivi Bhatia
Hi Peter, It gives me breakdown of all categories with their respective freq. Diploma general honors 50 45 105 On Sat, Jul 9, 2016 at 4:07 PM, peter dalgaard wrote: > > What does table(m11$prog) tell you? > -pd > > > On 09 Jul 2016, at 12:29 , Shivi Bhatia wrote:

Re: [R] 'ref' must be an existing level

2016-07-09 Thread peter dalgaard
What does table(m11$prog) tell you? -pd > On 09 Jul 2016, at 12:29 , Shivi Bhatia wrote: > > Dear Team, > > I am running a multinomial logistic regression model for one of the > fictitious data before i implement the same on my real data. > Here i am trying to predict based some scores and eco

[R] 'ref' must be an existing level

2016-07-09 Thread Shivi Bhatia
Dear Team, I am running a multinomial logistic regression model for one of the fictitious data before i implement the same on my real data. Here i am trying to predict based some scores and economic group whether a person will go for a diploma, general or honors. The code below: m11$prog2<- relev