Re: [R] Can't find all levels of categorical predictors in output of zeroinfl()

2012-03-04 Thread Petr PIKAL
Hi Far from being an expert in this field I assume the answer is that it is included in intercept term. It has something to do with contrasts specification, but its usage is above my modelling knowledge. You could try to see what ?contrasts tells you. Regards Petr you can > > Hello, > I’m

Re: [R] If function error: missing value where TRUE/FALSE needed

2012-03-04 Thread Petr PIKAL
Hi It is strange. I get completely different error. > dispersal[1] <- if (any (relativenes[1] < cost)) ((relativenes[1]- cost)/(relativenes[1]- cost*cost)) else 0 Error: object 'relativenes' not found > for (i in 2: time){dispersal[i] <- if (any (relativenes[i] < cost)) ((relativenes[i]- cost

Re: [R] the problem about sample size

2012-03-04 Thread Petr PIKAL
Hi I am not at all an expert in this matter, so you shall copy you message to r-help list too. However I would try na.action=na.exclude as it shall preserve the length of variables. Regards Petr > > Hi, > > Sorry I didn't know the original post in this thread was not included. I'm > using

Re: [R] how I can explore the variable names in my covariance matrix?

2012-03-04 Thread malcolm
QQ<-diag(7) for (j in 1:7){ for (k in 1:7){ sum=0 for (i in 1:50){ sum=sum+(Y[i,j]-mean(Y[,j]))*(Y[i,k]-mean(Y[,k])) } QQ[j,k]=sum/49 } } round(QQ,2) this is the function I made -- View this message in context: http://r.789695.n4.nabble.com/how-I-can-explore-the-variable-names-in-my-covariance-m

[R] how I can explore the variable names in my covariance matrix?

2012-03-04 Thread malcolm
Hi all! I am writing because I have a small problem I have a matrix with different variables names I made a function to compute the covariance matrix for my first matrix, but the variables names changed to numbers e.s [,1] how I can explore the variable names in my covariance matrix

Re: [R] how I can explore the variable names in my covariance matrix?

2012-03-04 Thread branch.lizard
Can you provide a sample of code for us? -- View this message in context: http://r.789695.n4.nabble.com/how-I-can-explore-the-variable-names-in-my-covariance-matrix-tp4445149p4445156.html Sent from the R help mailing list archive at Nabble.com. __ R-he

[R] If function error: missing value where TRUE/FALSE needed

2012-03-04 Thread charo san andres
Hello! I am trying to get a logic estatement in R using the if function, but it is all the time comming and error, I have tryied different methods but nothing is working the sentence is the following: dispersal[1] <- if (any (relativenes[1] < cost)) ((relativenes[1]- cost)/(relativenes[1]- co

Re: [R] Which packages are installed with the default R installation?

2012-03-04 Thread Joshua Wiley
Hi D. Isler, It is not a very good sign if you are indeed missing the find.package() function, this is in the base package, and if functions from base are missing, your entire version of R is likely corrupt. If you just do not have some packages you want, and are having dependency issues, make su

Re: [R] data generation

2012-03-04 Thread Joshua Wiley
Hi deb, I am not clear what you want exactly, but something like: x <- runif(1000) y <- x^2 + rnorm(1000, mean = 0, sd = 1) might do what you want. See ?runif for documentation. It generates random numbers from the uniform distribution, and ditto for rnorm except from normal. Cheers, Josh O

[R] new to repeated measures anova in R

2012-03-04 Thread Tamre Cardoso
Data set up as one observation/subject looks like (with a total of 10 subjects) Two treatments: shoe type with 3 categories and region with 8 categories ==> 24 "treatment" columns Subject PHallux PMidToes PLatToe PMTH1 PMidMTH PLatMTH PMidfoot PRearfoot LHallux LMidToes LLatToe LMTH1

[R] Forward stepwise regression using lmStepAIC in Caret

2012-03-04 Thread Dan Putka
I'm looking for guidance on how to implement forward stepwise regression using lmStepAIC in Caret. The stepwise "direction" appears to default to "backward". When I try to use "scope" to provide a lower and upper model, Caret still seems to default to "backward". Any thoughts on how I can make t

[R] data generation

2012-03-04 Thread mail me
Hi: I am trying to generate data form a simple linear regression model. The training data T = {(x1, y1), . . . , (xn), yn}, want to sample x uniformly from the range [0,1], find uncorrupted response y = x^2, and generate random noise "e" from normal distribution N(0, 1). Any idea how to do in sim

[R] Trouble with strwrap function

2012-03-04 Thread Aimee Jones
Hi all, I am formatting some graphs and adding text to them. When using the strwrap function in the code below, it properly cuts the main title into sizeable chunks and pastes the second line below that of the first. The subtitle however, is all pasted on the same line, meaning that it reads as gi

Re: [R] Using ddply within a function by argument transfer

2012-03-04 Thread Ista Zahn
Hi, On Sunday, March 04, 2012 03:28:44 PM Fredrik Karlsson wrote: > Hi Joshua, > > Yes, sorry - I attached an .rda file - maybe it was squashed. > Anyway, yes, I agree with you that the function in the present state would > not be of very much help to an end user (and your right in thinking that >

Re: [R] Which packages are installed with the default R installation?

2012-03-04 Thread David Winsemius
On Mar 4, 2012, at 4:22 PM, maya wrote: Hello, I am a new R user, I have one R version in my Macbook and one in a ubuntu desktop. I was installing some packages from a secure private source to the R in ubuntu and it replaced some of the existing packages. While the version in my macbook

Re: [R] Using ddply within a function by argument transfer

2012-03-04 Thread Joshua Wiley
Well, the only part that did not work nicely was the inside function. So you could still probably lean on ddply() for much of the work and just append the output of your function to the ddply results or something like that. You might also try to think about your problem in a different way. Sometim

Re: [R] TM reader with text

2012-03-04 Thread Mickael R problem
"Try this before running removePuncutation(): corpus <- tm_map(corpus, function(x) gsub("[\'\U2019]«»", " ", x))" It will replace quotation marks with a space, and that's enough to separate them from the rest of the word. I try to use your solution. It's work only for characters, not for a Corpus,

Re: [R] Using ddply within a function by argument transfer

2012-03-04 Thread Fredrik Karlsson
Hi Joshua, Yes, sorry - I attached an .rda file - maybe it was squashed. Anyway, yes, I agree with you that the function in the present state would not be of very much help to an end user (and your right in thinking that this is not the end implementation of the function, just an example). I too c

Re: [R] Could not compute QR decomposition of Hessian.

2012-03-04 Thread John Fox
Dear Kino, As it stands this model doesn't make sense: You've *both* set a reference indicator for each factor, by fixing a factor loading to 1, and fixed the variances of the factors 1. You should do one or the other. You say near the end of your message that you did try freeing the factor varian

Re: [R] Grouped barchart confidence intervals in lattice

2012-03-04 Thread ilai
packet.number() will retrieve the panel you are working in. With a third conditioning variable, you now have say a list of *.err$x, one for each panel/level of 3rd var. In that case you need dsl[[packet.number()]] to get at the right place in the list (or [,packet.number()] if it's a matrix etc.).

Re: [R] type conversion

2012-03-04 Thread Petr Savicky
On Sun, Mar 04, 2012 at 03:18:33PM -0600, Matyas Sustik wrote: > Hi All, > > I am confused by a type conversion happening against my intent. > > In an R script I allocate a matrix X, and I pass it to a C function > by using > > tmp -< .C(..., as.double(X),...). > > I use as.double() because I r

Re: [R] additional "X" characters in headers

2012-03-04 Thread Ben Bolker
[cc'ing back to r-help] On 12-03-04 05:07 PM, Mateusz Kędzior wrote: > Sorry, may I ask one more question? > What does "X" exactly meand and why without it, it's invalid variable name? Follow the documentation link to ?make.names to see the definition of a valid variable name (hint, it can't

Re: [R] Can't find all levels of categorical predictors in output of zeroinfl()

2012-03-04 Thread Achim Zeileis
On Sun, 4 Mar 2012, j.straka wrote: Hello, I?m using zero-inflated Poisson regression via the zeroinfl() function to analyze data on seed-set of plants, but for some reason, I don?t seem to be getting the output for all three levels of my two categorical predictors. More about my data and mod

Re: [R] additional "X" characters in headers

2012-03-04 Thread Ben Bolker
Mateusz Kędzior gmail.com> writes: > I want to prepare boxplot graphs from CSV files which containt in first row > years. > I've tried to use both read.table and read.CSV functions, but each of them > add "X" to year in header, > so I can see: X2012 instead of simply 2012. > After calling boxplot

[R] Jackknife for a 2-sample dispersion test

2012-03-04 Thread NS
Hi All, I'm not able to figure out how to perform a Jackknife test for a 2-sample dispersion test in R. Is there a built-in function to perform this or do we have to take a step by step approach to calculate the test statistic? Any help would be awesome. Thanks! -- View this message in contex

[R] additional "X" characters in headers

2012-03-04 Thread Mateusz Kędzior
I want to prepare boxplot graphs from CSV files which containt in first row years. I've tried to use both read.table and read.CSV functions, but each of them add "X" to year in header, so I can see: X2012 instead of simply 2012. After calling boxplot those strange signs weren't removed. Is there an

[R] Could not compute QR decomposition of Hessian.

2012-03-04 Thread Kino Aguilar
Hi, I created the model below, which returns me the following warning message: In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : Could not compute QR decomposition of Hessian. Optimization probably did not converge. # Model mDPDF = data.frame(mj1

[R] Can't find all levels of categorical predictors in output of zeroinfl()

2012-03-04 Thread j.straka
Hello, I’m using zero-inflated Poisson regression via the zeroinfl() function to analyze data on seed-set of plants, but for some reason, I don’t seem to be getting the output for all three levels of my two categorical predictors. More about my data and model: My response variable is the number o

[R] Which packages are installed with the default R installation?

2012-03-04 Thread maya
Hello, I am a new R user, I have one R version in my Macbook and one in a ubuntu desktop. I was installing some packages from a secure private source to the R in ubuntu and it replaced some of the existing packages. While the version in my macbook works all ok, in the Ubuntu version of R, I am mis

[R] convert point data to grid

2012-03-04 Thread uday
I would like to convert my point data to grid data my data contains e.g lat <- c(25.1618 , 24.8664, 21.0575, 21.1537, 21.2477, 21.3403, 20.7617, 20.8577, 20.9516, 21.0443) lon <- c(55.7660, 55.6890, 54.7205, 54.2142, 53.7105,53.2053, 54.6470, 54.1419, 53.6389, 53.1348) z <- c(

[R] type conversion

2012-03-04 Thread Matyas Sustik
Hi All, I am confused by a type conversion happening against my intent. In an R script I allocate a matrix X, and I pass it to a C function by using tmp -< .C(..., as.double(X),...). I use as.double() because I read that it makes sure that the parameter passing is correct. I return the matrix

Re: [R] Using ddply within a function by argument transfer

2012-03-04 Thread Joshua Wiley
Hi, Still no data (either not attached or a format the mail server scrubs), but I made some up. ddply seems to be a bit tricky in that it holds off evaluating its arguments. I honestly am not sure how to get around that---no amount of fancy footwork with eval() or quote() is going to change the

Re: [R] Intersection of two chromosomal ranges

2012-03-04 Thread Martin Morgan
On 03/04/2012 11:06 AM, Yadav Sapkota wrote: Hi, I want to merge multiple chromosomal regions based on their common intersecting regions. I tried couple of things using while and if loops but did not work out. I would appreciate if anyone could provide me a small piece of code in R to get the i

[R] Matrix Package, sparseMatrix, more NaN's than zeros

2012-03-04 Thread Ben quant
Hello, I have a lot of data and it has a lot of NaN values. I want to compress the data so I don't have memory issues later. Using the Matrix package, sparseMatrix function, and some fiddling around, I have successfully reduced the 'size' of my data (as measured by object.size()). However, NaN va

Re: [R] Dataframes in PLS package

2012-03-04 Thread westland
R still doesn't seem to recognize the data.frame ... I get a [6] ERROR: object 'depy.w' not found from the following code: dep <- pls[,1:4] ind <- pls[,5:8] eqn <- data.frame(depy = dep, indx = ind) apls <- plsr(depy.w + depy.h + depy.d + depy.s ~ indx.a + indx.i + indx.r + indx.x, data=eqn)

Re: [R] Dataframes in PLS package

2012-03-04 Thread westland
Thanks Michael. I had tried to drop the I(as.matrix(...)) conversions, and fiddled with a number of other permutations of code ... I still can't seem to get it right. The col names appear to be depy and indx ... here is the output (and the rows are just line numbers) > colnames(eqn) [1] "dep

Re: [R] Dataframes in PLS package

2012-03-04 Thread westland
The attach(eqn) seems to change some things in the format, but doesn't solve the problem ... here is my script > dep <- pls[,1:4] > ind <- pls[,5:8] > eqn <- data.frame(depy = dep, indx = ind) > attach(eqn) The following object(s) are masked from 'eqn (position 3)': depy.d, depy.h, depy.

Re: [R] Store vectors as values in xts time-series object

2012-03-04 Thread Sergey Pisarenko
Joshua, Thank you for explaining this. I will think of a work-around. /Sergey On Sun, Mar 4, 2012 at 3:36 PM, Joshua Ulrich wrote: > Hi Sergey, > > Internally, xts objects are a matrix with an index attribute.  While > you *can* make a matrix of lists, that is not supported in zoo or xts. > > B

[R] Intersection of two chromosomal ranges

2012-03-04 Thread Yadav Sapkota
Hi, I want to merge multiple chromosomal regions based on their common intersecting regions. I tried couple of things using while and if loops but did not work out. I would appreciate if anyone could provide me a small piece of code in R to get the intersection of following example: chr1: 100-15

Re: [R] Dataframes in PLS package

2012-03-04 Thread R. Michael Weylandt
It's nice to cc the list for archival reasons -- it also usually gets you a faster response as more folks can see how the thread develops. The problem is that the colnames aren't ctually depy and indx: they are depy.w, depy.h, etc. If you want to model, you need to use those as is: e.g., with your

[R] quantmod getOptionChain Not Work

2012-03-04 Thread Sparks, John James
Dear R Helpers, I am still having trouble with the getOptionChain command in quantmod. I have the latest version of quantmod, etc. so I was under the impression that the problem was solved with updates to the package. If someone could let me know what I need to install in order to make this work

Re: [R] Dataframes in PLS package

2012-03-04 Thread R. Michael Weylandt
No. Do not do that. While it looks nice at first, it quickly becomes the source of innumerable errors. Michael On Sun, Mar 4, 2012 at 1:56 AM, Kazuo Ishii wrote: > 2012/3/4, westland : >> I am still/again having trouble getting PLSR to recognize the input data >> frames.   Here is what I have do

Re: [R] Using ddply within a function by argument transfer

2012-03-04 Thread Fredrik Karlsson
Hi, Sorry all - I will provide a reproducable version of this. I am still seeing the same problem - maybe it is due to me having to use summarize? Anyway, here is an example (using the data set attached): Two test functions: insidefun <- function(x){ return(x+1) } testfun <- function(data,fa

Re: [R] Changing the frequency of time series

2012-03-04 Thread David Winsemius
On Mar 4, 2012, at 4:51 AM, Ajay Askoolum wrote: I know how to do this when creating the time series variable in one expression, e.g. valuesTS1<-ts(values,start=2000); # Frequency naturally defaults to 1 How can I specify the frequency of a time series? I do not see a `frequency<-` usag

Re: [R] Using ddply within a function by argument transfer

2012-03-04 Thread David Winsemius
On Mar 4, 2012, at 12:20 AM, Fredrik Karlsson wrote: Hi Michael, No, sorry - that is neither the problem or the solution. suspicious.vowels(pb,c("Type","Sex","Vowel"),F1,F2) Error in mean(y, na.rm = na.rm) : object 'f1' not found Obviously you have still failed to offer reproducible code

Re: [R] Store vectors as values in xts time-series object

2012-03-04 Thread Joshua Ulrich
Hi Sergey, Internally, xts objects are a matrix with an index attribute. While you *can* make a matrix of lists, that is not supported in zoo or xts. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com On Sun, Mar 4, 2012 at

Re: [R] p-value from GLM

2012-03-04 Thread peter dalgaard
On Mar 4, 2012, at 12:21 , Dunia Scheid wrote: > Dear all, > > I am fitting a GLM similar to > > library(MASS) > anorex.1 <- glm(Treat~Postwt+Prewt,family = binomial, data = anorexia) I hope that's just for an example. The actual analysis makes zero sense to me... > > I have found two ways o

Re: [R] TM reader with text

2012-03-04 Thread Milan Bouchet-Valat
Le samedi 03 mars 2012 à 16:56 -0800, Mickael R problem a écrit : > Hello everybody, > I don't give up the fight, but it's hard. I have finded a solution for the > ligature with a best converter wich tranlated more precisely PDF to plain > text. But a new problem has occured. In french particulary,

[R] p-value from GLM

2012-03-04 Thread Dunia Scheid
Dear all, I am fitting a GLM similar to library(MASS) anorex.1 <- glm(Treat~Postwt+Prewt,family = binomial, data = anorexia) I have found two ways of computing the p-value of the fitted model: pval1 <- 1-pchisq(anorex.1$deviance,anorex.1$df.residual) pval2 <- 1-pchisq(anorex.1$null.deviance - an

[R] Store vectors as values in xts time-series object

2012-03-04 Thread Sergey Pisarenko
Hi R programmers, I have stumbled across what seems a very simple problem. My goal is to create a xts time series object which contains vectors as values. In other words, I try to create something like this: 2009-01-01 => c('aa', 'bb', 'dd') ... 2010-02-01 => c('mm') I have figured out parts of

Re: [R] times series trellis plot

2012-03-04 Thread Stefan Luedtke
Thanks, a lot!! On Fri, 2012-03-02 at 18:00 -0500, Gabor Grothendieck wrote: > On Fri, Mar 2, 2012 at 5:15 PM, sluedtke wrote: > > Dear List, > > > > I am struggling with the trellis graphic. A similar problem was mentioned > > here: > > > > http://r.789695.n4.nabble.com/R-How-can-you-get-N-rep

[R] Changing the frequency of time series

2012-03-04 Thread Ajay Askoolum
I know how to do this when creating the time series variable in one expression, e.g. valuesTS1<-ts(values,start=2000); # Frequency naturally defaults to 1 How can I specify the frequency of a time series? > values=c(12,34,65,12); > values<-ts(values); > frequency(values); [1] 1 > start(values)