Re: [R] SLR 500 Random Samples

2010-02-14 Thread Dimitris Rizopoulos
it seems that this is a homework! Please read carefully the Posting Guide: http://www.r-project.org/posting-guide.html -- the R-help mailing list is not intended for "Basic Statistics and classroom homework"! Best, Dimitris Schwonka wrote: Consider the SLR y = 50 + 10x + e where e is NID(0.

[R] SLR 500 Random Samples

2010-02-14 Thread Schwonka
Consider the SLR y = 50 + 10x + e where e is NID(0.16). n = 20 pairs of observations. Generate 500 samples of 20 obersvations drawing 1 observations drawing one observation from each level of x = .5,1,1.5 ... 10 for each sample A) For each sample computer the least squares regression estimates of

Re: [R] Creating a new Access database with R

2010-02-14 Thread Ryusuke Kenji
I have just got an idea which is using RExcel and coding with Excel VBA may cope with it, its work!!! Ryusuke From: urishim...@optiver.com To: ryusukeke...@hotmail.com Date: Mon, 15 Feb 2010 08:31:49 +0100 Subject: RE: RE:Creating a new Access database with R No idea, sorry.

Re: [R] lm function in R

2010-02-14 Thread kMan
Dear Something, Ah, you need accessor functions. Set your lm() call to a variable name. If my data frame or object is called dat, for example, I usually use dat.lm. summary(dat.lm) resid(dat.lm) ?summary.lm gives a host of information, including summary(dat.lm)$sigma and $df for resolving

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Johannes Graumann
Rolf Turner wrote: > > On 15/02/2010, at 9:40 AM, Johannes Graumann wrote > > > > (In response to some advice from David Winsemius): > >> I am quite certain that this is the most elaborately worded version of >> "RTFM" I have ever come across. > > > I nominate this as a fortune. (Despite P

Re: [R] Plot different regression models on one graph

2010-02-14 Thread kMan
Dear Peter, Ah, I see your point, Professor. The point at x=23.5 is carrying the model. Allow me to clarify. I was making a similar point. I was suggesting that the cube term could be left in the model, as you did, but rather than dropping the data-point, another model is fit with an additional p

Re: [R] Separating columns, and sorting by rows

2010-02-14 Thread David Winsemius
On Feb 15, 2010, at 1:22 AM, milton ruser wrote: Hi Raging Jim may be this is a starting point. myDF<-read.table(stdin(),head=T,sep=",") Those "mm" entries will become factors, which can lead to confusion for newbies. Might be more straightforward to always use stringsAsFactors=FALS

[R] Exponential Fitting to Credit default data - A theoretical query

2010-02-14 Thread Julia Cains
Dear R helpers   I am working on the credit risk default data and am referring to "An introduction to Credit Risk Modelling" by Christian Bluhm. The literature affirms that 'the default frequencies grow exponentially with decreasing credit worthiness'.   I have a data of rating wise default fre

Re: [R] Separating columns, and sorting by rows

2010-02-14 Thread milton ruser
Hi Raging Jim may be this is a starting point. myDF<-read.table(stdin(),head=T,sep=",") mm,Rainfall 1977-02,17.4 1977-03,34.0 1977-04,26.2 1977-05,42.6 1977-06,58.6 1977-07,23.2 1977-08,26.8 1977-09,48.4 1977-10,47.0 1977-11,37.2 1977-12,15.0 1978-01,2.6 1978-02,6.8 1978-03,9.0 1978-04,46.6

[R] GAM for non-integer proportions

2010-02-14 Thread Julian Burgos
Dear list, I´m using the mgcv package to model the proportion by weight of certain prey on the stomach content of a predator. This proportion is the ratio of two weights (prey weight over stomach weight), and ranges between 0 and 1. The variance is low when proportion is close to 0 and 1, and hi

Re: [R] Separating columns, and sorting by rows

2010-02-14 Thread RagingJim
the other alternative would be to edit my sql query so that that data is brought in from the database and put in to the correct format initially. "sqlQuery(conn, "select lsd,ttl_mo_prcp from mo_rains where stn_num=23090")" That is my very basic query. I have also been given this for use in orcal

[R] Separating columns, and sorting by rows

2010-02-14 Thread RagingJim
Dear anyone who knows more about R than me (so everyone). I have been bashing my head on the keyboard all day trying to do something with my table. I have some data, like so: -mm Rainfall(mm) 1 1977-0217.4 2 1977-0334.0 3 1977-0426.2 4 1977-054

[R] error message error

2010-02-14 Thread Roslina Zakaria
Hi r-users,   I hope somebody can help me to understand the error message.  Here is my code; ## Newton iteration newton_gam <- function(z) { n   <- length(z)   r   <- runif(n)   tol <- 1E-6   cdf <- vector(length=n, mode="numeric")   fprime <- vector(length=n, mode="numeric")   f   <- vector(lengt

Re: [R] Plot different regression models on one graph

2010-02-14 Thread Peter Ehlers
kMan wrote: Peter wrote: You like to live dangerously. Clue me in, Professor. Sincerely, KeithC. Okay, Keith, here goes: dat <- structure(list(x = c(62.5, 68.5, 0, 52, 0, 52, 0, 52, 23.5, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), y = c(0.054, 0.055, 0.017, 0.021, 0.02, 0.028, 0.032, 0.073, 0.076

Re: [R] Difference in Levene's test between R and SPSS

2010-02-14 Thread Peter Ehlers
Ravi Kulkarni wrote: Hello, I notice that when I do Levene's test to test equality of variances across levels of a factor, I get different answers in R and SPSS 16. e.g.: For the chickwts data, in R, levene.test(weight, feed) gives F=0.7493, p=0.5896. SPSS 16 gives F=0.987, p=0.432 Why thi

[R] Using text put into a dialog box

2010-02-14 Thread RagingJim
I have written in R this: require(tcltk) tt<-tktoplevel() Name <- tclVar("") entry.Name <-tkentry(tt,width="20",textvariable=Name) tkgrid(tklabel(tt,text="Please enter site number.")) tkgrid(entry.Name) OnOK <- function() { NameVal <- tclvalue(Name) use.this=NameVal tkdes

[R] Difference in Levene's test between R and SPSS

2010-02-14 Thread Ravi Kulkarni
Hello, I notice that when I do Levene's test to test equality of variances across levels of a factor, I get different answers in R and SPSS 16. e.g.: For the chickwts data, in R, levene.test(weight, feed) gives F=0.7493, p=0.5896. SPSS 16 gives F=0.987, p=0.432 Why this difference? Which on

Re: [R] Shapiro-Wilk for levels of factor

2010-02-14 Thread Ravi Kulkarni
Thanks! Exactly what I wanted. Ravi -- View this message in context: http://n4.nabble.com/Shapiro-Wilk-for-levels-of-factor-tp1555254p1555720.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:/

[R] optimization problem with linear constraints

2010-02-14 Thread Kathie
Dear R users, I need some advises on how to use R to optimize this function with the following constraints. f(x1,x2,x3,y1,y2,y3,) = gamma(x1+x2-1)/{gamma(x1)*gamma(x2)} * y1^(x2-1) * y2^(x1-1) + gamma(x1+x3-1)/{gamma(x1)*gamma(x3)} * y1^(x3-1) * y3^(x1-1) + gamma(x2+x3-1)/{gamma(x2)*gamma(x3)

[R] R: Dimensional reduction package

2010-02-14 Thread mauede
Thank you. Sorry. My question is rather ambiguous. Imeant to aske for Dimensionality Reduction methods and/or Intrinsic Dimensionality Estimation methods that can deal with non-linear data. That is, data that do not lie on a hyper-plane. ISOMAP is one of such methods. LLE, AutoEncoder, GTM Kerne

Re: [R] Multiple missing values

2010-02-14 Thread Jim Lemon
John wrote: ... Does anyone know, or know documentation that describes, how to declare multiple values in R as missing that does not involve coding them as NA? I wish to be able to treate values as missing, while still retaining codes that describe the reason for the value being missing. I woul

Re: [R] Plot different regression models on one graph

2010-02-14 Thread kMan
Peter wrote: >You like to live dangerously. Clue me in, Professor. Sincerely, KeithC. -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Sunday, February 14, 2010 6:49 PM To: kMan Cc: 'David Winsemius'; 'Rhonda Reidy'; r-help@r-project.org Subject: Re: [R] Plot diff

Re: [R] Plot different regression models on one graph

2010-02-14 Thread Peter Ehlers
kMan wrote: I would use all of the data. If you want to "drop" one, control for it in the model & sacrifice a degree of freedom. You like to live dangerously. -Peter Ehlers Why the call to poly() by the way? KeithC. -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca

Re: [R] [Requires Classification] Re: Adding a regression line to an xyplot

2010-02-14 Thread Andrew McFadden
Thanks, yes that does the trick, sorry inadvertently left the "tavg" in my example. I haven't used the panel function before looks like it maybe useful. Really appreciate your help. regards Andrew McFadden MVS BVSc | Incursion Investigator (animals), Investigation and Diagnostic Centre | Biose

Re: [R] R project

2010-02-14 Thread Sarah Goslee
Those sound like basic questions. You should start by reading the Intro to R that can be found here http://cran.r-project.org/doc/manuals/R-intro.html or at www.r-project.org For your specific questions, searching for "histogram" or "bar chart" at http://www.rseek.org would be very helpful. If yo

[R] error message in endseq

2010-02-14 Thread nomis24
Hi there, I am new to R and feel so bloody stupid. Abut in spite of a search of several hrs I could not find an answer to my problem. I have imported SPSS data to R, and apart from some warnings regarding duplicate labels, everything looks fine and names lists all my variables. Then I try to run

[R] how to delete a parameter from list after running negative binomial error

2010-02-14 Thread Michelle Waterman
Hello everyone, Sorry if my question is not clear, my first language is not English, but Portuguese. I am building a model for my data, using non-binomial error. I am having a bit of a problem when updating the model to remove parameters that I no do no autocorrelate with other variables (I have

[R] gnls not optimizing values

2010-02-14 Thread Brian Doctrow
Sometimes when I try to fit a model to data using the gnls function, it doesn't return optimized values of the model parameters. Instead it just returns the exact same values I used as initial guesses, but with standard errors calculated. Example is as follows: two_site_mHb <- gnls(y ~ (CS

[R] R project

2010-02-14 Thread navid safavi
Dear Sir/Madam Could you pls help me at these subjects in R-project? How could I construct a table for 5 or 10 records of data set? How could I construct a bar chart for categorical variable with overlay? How could I construct a histogram for a categorical variable? pls inform me. Thanks in ad

Re: [R] Estimated Standard Error for Theta in zeroinfl()

2010-02-14 Thread Rolf Turner
On 15/02/2010, at 12:49 PM, Lam, Tzeng Yih wrote: > Dear R Users, > > When using zeroinfl() function to fit a Zero-Inflated Negative Binomial > (ZINB) model to a dataset, the summary() gives an estimate of log(theta) and > its standard error, z-value and Pr(>|z|) for the count component. > Ad

Re: [R] Adding a regression line to an xyplot

2010-02-14 Thread David Winsemius
On Feb 14, 2010, at 6:33 PM, Andrew McFadden wrote: Hi R users I am trying to add a regression line to a graph for "c" for factor 2 only. Any suggestions? library(lattice) a=(1:10) b=c(1:5,16:20) c=as.factor(c(rep(1,5),rep(2,5))) d=data.frame(a,b,c) xyplot(a~b, pch=c(6,8),data = tavg, gr

[R] Estimated Standard Error for Theta in zeroinfl()

2010-02-14 Thread Lam, Tzeng Yih
Dear R Users, When using zeroinfl() function to fit a Zero-Inflated Negative Binomial (ZINB) model to a dataset, the summary() gives an estimate of log(theta) and its standard error, z-value and Pr(>|z|) for the count component. Additionally, it also provided an estimate of Theta, which I belie

[R] Adding a regression line to an xyplot

2010-02-14 Thread Andrew McFadden
Hi R users > I am trying to add a regression line to a graph for "c" for factor 2 > only. Any suggestions? > library(lattice) a=(1:10) b=c(1:5,16:20) c=as.factor(c(rep(1,5),rep(2,5))) d=data.frame(a,b,c) xyplot(a~b, pch=c(6,8),data = tavg, groups=d$c, reg.line=lm, smooth=FALSE, type=c("p","g")

Re: [R] Plot different regression models on one graph

2010-02-14 Thread kMan
Dear Rhonda, Consider curve(). KeithC. -Original Message- From: Rhonda Reidy [mailto:rre...@gmail.com] Sent: Saturday, February 13, 2010 11:36 AM To: r-help@r-project.org Subject: [R] Plot different regression models on one graph The following variables have the following significant r

Re: [R] Plot different regression models on one graph

2010-02-14 Thread kMan
I would use all of the data. If you want to "drop" one, control for it in the model & sacrifice a degree of freedom. Why the call to poly() by the way? KeithC. -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Saturday, February 13, 2010 1:35 PM To: David Winsemius

Re: [R] Dimensional reduction package

2010-02-14 Thread Michael Denslow
Hi Maura, > Is there any R package which implements non-linear dimensionality reduction > (LLE, ISOMAP, GTM, and so on)  and/or intrinsic dimensionality estimation ? I am not exactly sure what is meant by non-linear dimensionality reduction but there is an isomap function in vegan. This is the i

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Rolf Turner
On 15/02/2010, at 9:40 AM, Johannes Graumann wrote (In response to some advice from David Winsemius): > I am quite certain that this is the most elaborately worded version of > "RTFM" I have ever come across. I nominate this as a fortune. (Despite Prof. Winsemius's later protestati

Re: [R] xyplot, overlay two variables on one plot with group factors

2010-02-14 Thread David Winsemius
On Feb 14, 2010, at 3:44 PM, Pat Schmitz wrote: All I want to overlay two variables on the same plot following their appropriate grouping. I have attempted to use subscripting in panel with panel.xyplot, but I can't get the grouping to follow into the panel...here is an example... dat<

Re: [R] xyplot, overlay two variables on one plot with group factors

2010-02-14 Thread Pat Schmitz
Ok...I realized that if I don't wish to compare the groupings directly i can plot the groups as separate panels, which is a much more simple solution, but doesn't necessarily give the same effect. xyplot(y+y2 ~ x | grp, dat) On Sun, Feb 14, 2010 at 3:19 PM, Dennis Murphy wrote: > Hi: > > Here

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread David Winsemius
On Feb 14, 2010, at 3:40 PM, Johannes Graumann wrote: David Winsemius wrote: On Feb 14, 2010, at 10:33 AM, Johannes Graumann wrote: Hello, When drawing "barcharts", I find it not helpful if ylim[1] != 0 - bars for a quantity of 0, that do not show a length of 0 are quite non- intuitive.

Re: [R] multiple-test correlation

2010-02-14 Thread Robert A LaBudde
At 07:35 AM 2/14/2010, Manuel Jesús López Rodríguez wrote: Dear all, I am trying to study the correlation between one "independent" variable ("V1") and several others dependent among them ("V2","V3","V4" and "V5"). For doing so, I would like to analyze my data by multiple-test (applying the B

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Johannes Graumann
Deepayan Sarkar wrote: > On Sun, Feb 14, 2010 at 7:33 AM, Johannes Graumann > wrote: >> Hello, >> >> When drawing "barcharts", I find it not helpful if ylim[1] != 0 - bars >> for a quantity of 0, that do not show a length of 0 are quite >> non-intuitive. >> >> I have tried to study >> > library(l

[R] xyplot, overlay two variables on one plot with group factors

2010-02-14 Thread Pat Schmitz
All I want to overlay two variables on the same plot following their appropriate grouping. I have attempted to use subscripting in panel with panel.xyplot, but I can't get the grouping to follow into the panel...here is an example... dat<-data.frame( y= log(1:10), y2=10:19, x=1:10, grp = as.fa

[R] sas.get and Windows: WAS RE: SAS and RODBC

2010-02-14 Thread Daniel Nordlund
> -Original Message- > From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] > Sent: Sunday, February 14, 2010 7:09 AM > To: Daniel Nordlund > Cc: r-help@r-project.org > Subject: Re: [R] SAS and RODBC > > > > On 14.02.2010 08:19, Daniel Nordlund wrote: > >> -Original Message-

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Johannes Graumann
David Winsemius wrote: > > On Feb 14, 2010, at 10:33 AM, Johannes Graumann wrote: > >> Hello, >> >> When drawing "barcharts", I find it not helpful if ylim[1] != 0 - >> bars for a >> quantity of 0, that do not show a length of 0 are quite non-intuitive. >> >> I have tried to study >> > library(l

[R] Problem with specifying variance-covariance matrix for random effects (nlme package)

2010-02-14 Thread Benjamin Cheah
Hi all, I've been struggling with trying to specify a diagnoal matrix for linear mixed effects model. I think I've got nearly everything correct, except the following message appears: In lme.formula(fixed = fwave ~ sex + sexXbulbar + visit + age + : Fewer observations than random effects in

Re: [R] unexpected results with higher-order functions and lapply

2010-02-14 Thread baptiste auguie
Hi, I believe it's lazy evaluation. See ?force HTH, baptiste On 14 February 2010 20:32, Jyotirmoy Bhattacharya wrote: > I want to use lapply and a function returning a function in order to build a > list of functions. > >> genr1 <- function(k) {function() {k}} >> l1 <- lapply(1:2,genr1) >> l1[

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-14 Thread Dimitri Shvorob
My bad: once I ran dev.off(), I did get a plot, albeit a blank one. Then I removed xlim - which I put in after qplot's complain about xlim - and voila! Thanks a lot. -- View this message in context: http://n4.nabble.com/Problems-with-boxplot-in-ggplot2-qplot-tp1555338p1555352.html Sent from the

[R] unexpected results with higher-order functions and lapply

2010-02-14 Thread Jyotirmoy Bhattacharya
I want to use lapply and a function returning a function in order to build a list of functions. > genr1 <- function(k) {function() {k}} > l1 <- lapply(1:2,genr1) > l1[[1]]() [1] 2 This was unexpected. I had expected the answer to be 1, since that is the value k should be bound to when genr1 is ap

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-14 Thread Dimitri Shvorob
... Unfortunately, a problem remains: I cannot label x ticks a la 'names.arg = '. month has values like '2009-01-01', '2009-02-01', etc., while I would prefer 'Jan', 'Feb'. Using closed$month = format(closed$month, "%b") disrupts the order of plot's panels, which now follows the alphabetic o

Re: [R] Newbie woes with *apply

2010-02-14 Thread Gabor Grothendieck
Your function is not receiving what you may think its receiving. Try this: > x <- Sys.Date() + 1:3 > junk <- lapply(x, print) [1] 14655 [1] 14656 [1] 14657 So add this as the first statement in the body of each of your functions: date <- as.Date(date, "1970-01-01") and then using x from above t

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-14 Thread baptiste auguie
Hi, it's hard to tell what's wrong without a reproducible example, but I noted two things: - AFAIK there is no plot method for ggplot2. You probably meant print(p) instead - if you map x to factor(month), I think it will be incompatible with your xlim values range(month). HTH, baptiste On 14

[R] Problems with boxplot in ggplot2:qplot

2010-02-14 Thread Dimitri Shvorob
Dataframe closed contains balances of closed accounts: each row has month of closure (Date-type column month) and latest balance. I would like to plot by-month distributions of balances. A qplot call below produces several warnings and no output. Can anyone help? Thank you. PS. A really basic

Re: [R] Newbie woes with *apply

2010-02-14 Thread Dimitri Shvorob
Many thanks, but my focus is actually on *apply usage. -- View this message in context: http://n4.nabble.com/Newbie-woes-with-apply-tp1555149p1555329.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list ht

[R] Keeping the attributes of an observation

2010-02-14 Thread John Lipkins
Hey R list, Can someone help me with following question? I can create a listing of the unique observations in a dataframe by using: df <- df [order(df $start),] df $first_ob[!duplicated(df $ID)] <- "1" df $first_ob[duplicated(df $ID)] <- "0" Now I want to hold specific attributes of the first o

Re: [R] Multiple missing values

2010-02-14 Thread Joe King
Gary King's Amelia package for R and a stand alone version does EM algorithm multiple imputation. Joe King 206-913-2912 j...@joepking.com "Never throughout history has a man who lived a life of ease left a name worth remembering." --Theodore Roosevelt -Original Message- From: r-help-boun.

[R] mlogit function cut off formular

2010-02-14 Thread Han Qin
I'm trying to fit a multinominal logistic model using package mlogit. I have 15 independent variables. The code looks like this: m<-mlogit(score~0|f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13+f14+f15, data, reflevel="1") And it gives the following error message: Error in parse(text = x) : unexpe

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Deepayan Sarkar
On Sun, Feb 14, 2010 at 7:33 AM, Johannes Graumann wrote: > Hello, > > When drawing "barcharts", I find it not helpful if ylim[1] != 0 - bars for a > quantity of 0, that do not show a length of 0 are quite non-intuitive. > > I have tried to study >        > library(lattice) >        > panel.barcha

Re: [R] evaluate variable within expression - how?

2010-02-14 Thread Jorge Ivan Velez
Hi Mark, Try also: plot(1:10) text(2, 5, "Some text", font = 2) HTH, Jorge On Sun, Feb 14, 2010 at 11:36 AM, Mark Heckmann <> wrote: > # I want to plot bold text. The text should depend on a variable > containing a character string. > > plot.new() > text(.5, .5, expression(bold("Some text"))

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread David Winsemius
On Feb 14, 2010, at 10:33 AM, Johannes Graumann wrote: Hello, When drawing "barcharts", I find it not helpful if ylim[1] != 0 - bars for a quantity of 0, that do not show a length of 0 are quite non-intuitive. I have tried to study > library(lattice) > panel.barchart but am

Re: [R] Multiple missing values

2010-02-14 Thread Frank E Harrell Jr
Patrick Burns wrote: I can think of a few solutions, none perfect. * You could have a master dataset that has the missing value codes you want, and a dataset that you use which is a copy of it with real NA's in it. * You could add an attribute that gives the types of missing values in the vario

Re: [R] evaluate variable within expression - how?

2010-02-14 Thread Peter Ehlers
Try text(.5, .5, bquote(bold(.(myText -Peter Ehlers Mark Heckmann wrote: # I want to plot bold text. The text should depend on a variable containing a character string. plot.new() text(.5, .5, expression(bold("Some text"))) # now I would like to do the same replacing "some text" by a

Re: [R] evaluate variable within expression - how?

2010-02-14 Thread baptiste auguie
Hi, Try with bquote, plot.new() myText <- "some text" text(.5, .5, bquote(bold(.(myText basically, bquote( .(myText) ) performs the substitution before applying bold() (see ?bquote). HTH, baptiste On 14 February 2010 17:36, Mark Heckmann wrote: > #  I want to plot bold text. The text sh

Re: [R] Shapiro-Wilk for levels of factor

2010-02-14 Thread Achim Zeileis
On Sun, 14 Feb 2010, Ravi Kulkarni wrote: Hello, I have data for an ANOVA where the between-subjects factor has three levels. How do I run a test of normality (using shapiro.test) on each of the levels of the factor for the dependent variable separately without creating extra datasets? You ca

[R] Shapiro-Wilk for levels of factor

2010-02-14 Thread Ravi Kulkarni
Hello, I have data for an ANOVA where the between-subjects factor has three levels. How do I run a test of normality (using shapiro.test) on each of the levels of the factor for the dependent variable separately without creating extra datasets? Thanks, Ravi __

[R] evaluate variable within expression - how?

2010-02-14 Thread Mark Heckmann
# I want to plot bold text. The text should depend on a variable containing a character string. plot.new() text(.5, .5, expression(bold("Some text"))) # now I would like to do the same replacing "some text" by a variable. plot.new() myText <- "some text" text(.5, .5, expression(bold(myText)))

Re: [R] Multiple missing values

2010-02-14 Thread Patrick Burns
I can think of a few solutions, none perfect. * You could have a master dataset that has the missing value codes you want, and a dataset that you use which is a copy of it with real NA's in it. * You could add an attribute that gives the types of missing values in the various positions. The dow

[R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Johannes Graumann
Hello, When drawing "barcharts", I find it not helpful if ylim[1] != 0 - bars for a quantity of 0, that do not show a length of 0 are quite non-intuitive. I have tried to study > library(lattice) > panel.barchart but am unable to figure out where ylim is taken care of and how one

Re: [R] Get rid of the first row of the LaTeX table generated by xtable

2010-02-14 Thread Shige Song
Dear Livlu and Uwe, This is exactly what I need, thanks. Shige On Sun, Feb 14, 2010 at 10:11 AM, Uwe Ligges wrote: > See ?print.xtable and its argument "include.rownames". > > Uwe Ligges > > On 14.02.2010 16:06, Shige Song wrote: >> >> Dear All, >> >> I am trying to generate a LaTeX table from

Re: [R] Multiple missing values

2010-02-14 Thread Gabor Grothendieck
NA, Inf, -Inf, NaN would give you 4 possibilities and is.finite would check if its any of them: > x <- c(1, NA, 2, Inf, 3, -Inf, 4, NaN, 5) > is.finite(x) [1] TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE You might need to map them all to NA before using it with various functions dependin

Re: [R] Get rid of the first row of the LaTeX table generated by xtable

2010-02-14 Thread Uwe Ligges
See ?print.xtable and its argument "include.rownames". Uwe Ligges On 14.02.2010 16:06, Shige Song wrote: Dear All, I am trying to generate a LaTeX table from a small data frame using xtable. I have three variable and 10 records. However, the resulted LaTeX table has four columns (instead of th

Re: [R] Get rid of the first row of the LaTeX table generated by xtable

2010-02-14 Thread Liviu Andronic
On 2/14/10, Shige Song wrote: > column seems to be an automatically generated ID. Is there a way to > get rid of this column? > Perhaps ?print.xtable include.rownames=F Liviu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

Re: [R] SAS and RODBC

2010-02-14 Thread Uwe Ligges
On 14.02.2010 08:19, Daniel Nordlund wrote: -Original Message- From: Frank E Harrell Jr [mailto:f.harr...@vanderbilt.edu] Sent: Saturday, February 13, 2010 5:49 AM To: Daniel Nordlund Cc: r-help@r-project.org Subject: Re: [R] SAS and RODBC Daniel Nordlund wrote: . . . This is just a

[R] Get rid of the first row of the LaTeX table generated by xtable

2010-02-14 Thread Shige Song
Dear All, I am trying to generate a LaTeX table from a small data frame using xtable. I have three variable and 10 records. However, the resulted LaTeX table has four columns (instead of three), of which the first column seems to be an automatically generated ID. Is there a way to get rid of this

Re: [R] Newbie woes with *apply

2010-02-14 Thread Gabor Grothendieck
Try library(zoo) x <- as.Date(seq(1, 500, 50)) # test data as.Date(as.yearmon(x)) as.Date(as.yearqtr(x)) On Sun, Feb 14, 2010 at 8:59 AM, Dimitri Shvorob wrote: > > Dataframe cust has Date-type column open.date. I wish to set up another > column, with (first day of) the quarter of open.date. >

[R] Multiple missing values

2010-02-14 Thread John
Does anyone know, or know documentation that describes, how to declare multiple values in R as missing that does not involve coding them as NA? I wish to be able to treate values as missing, while still retaining codes that describe the reason for the value being missing. Thanks John MAcInnes -

Re: [R] Newbie woes with *apply

2010-02-14 Thread Dimitri Shvorob
Bug fix: first.day.of.quarter = function(date) { t = first.day.of.month(date) l = month(date) %% 3 if (l == 0) return(t) t = seq.Date(t, by = "-1 month", length = l) return(t[length(t)]) } But the *apply part still does not work. -- View this message in context: http://n4.nabble.com

[R] Newbie woes with *apply

2010-02-14 Thread Dimitri Shvorob
Dataframe cust has Date-type column open.date. I wish to set up another column, with (first day of) the quarter of open.date. To be comprehensive (of course, improvement suggestions are welcome), month = function(date) { return(as.numeric(format(date,"%m"))) } first.day.of.month = function(da

[R] Help for programming a short code in R

2010-02-14 Thread Michael Haenlein
Dear all, I'm looking for a person who could help me to program a short code in R. The code involves Bayesian analysis so some familiarity with WinBUGS or another package/ software dealing with Bayesian estimation would be helpful. I have an academic paper in which the code is described ("Abe, M

Re: [R] lm function in R

2010-02-14 Thread Douglas Bates
On Sat, Feb 13, 2010 at 7:09 PM, Daniel Malter wrote: > It seems to me that your question is more about the econometrics than about > R. Any introductory econometric textbook or compendium on econometrics will > cover this as it is a basic. See, for example, Greene 2006 or Wooldridge > 2002. > > S

Re: [R] Labels on a pyramide

2010-02-14 Thread Orvalho Augusto
Pardon my ignorance here. The Jim code works. But the problem the text comes over the plot. Adjusting the laxlab and raxlab, to get more plot are, the text keeps being cut. And one more thing that might be added as a new functionality is an option to show the value of the bar. Thanks for your he

[R] multiple-test correlation

2010-02-14 Thread Manuel Jesús López Rodríguez
Dear all, I am trying to study the correlation between one "independent" variable ("V1") and several others dependent among them ("V2","V3","V4" and "V5"). For doing so, I would like to analyze my data by multiple-test (applying the Bonferroni´s correction or other similar), but I do not find th

Re: [R] Labels on a pyramide

2010-02-14 Thread Orvalho Augusto
Jim thanks for your great! I will try to use your source code. Caveman Ps: Reconheco a minha trogolodice e por isso pedi ajuda. Lamento perturbar a todos por isso. On Sun, Feb 14, 2010 at 1:05 PM, Jim Lemon wrote: > On 02/14/2010 01:27 AM, Orvalho Augusto wrote: >> >> I am using pyramid.plot()

Re: [R] Labels on a pyramide

2010-02-14 Thread Jim Lemon
On 02/14/2010 01:27 AM, Orvalho Augusto wrote: I am using pyramid.plot() from the plotrix package. ... The problem is (1) I do not want plot agelabels on the center and (2) I want plot different labels for each pair of the bars (one label for masculine and the other feminine). The data represent

Re: [R] Problem in performing goodness of fit test in R.

2010-02-14 Thread Ted Harding
Good that you got it to work somehow! Faiz: can you report the result, exactly as returned by R, of sum(c(1,1,1,1,1,1)/6) - 1 ?? On my Linux with R version 2.10.0 (2009-10-26) this gives 0. (And, by the way, did you really mean to say you were using "R 2.1.01"? Was this a typing error for "R

Re: [R] Problem in performing goodness of fit test in R.

2010-02-14 Thread Joshua Wiley
Dear Faiz, On Sat, Feb 13, 2010 at 11:42 PM, Faiz Rasool wrote: > The erorr I receive is "erorr in chisq.test(freq,p=prob)/6 probabilities > must sum to 1" This error message seems a little off. It looks like the entire chi squared test was divided by 6. Notice that the /6 occurs *after* the

Re: [R] Problem in performing goodness of fit test in R.

2010-02-14 Thread Ted Harding
On 14-Feb-10 07:42:12, Faiz Rasool wrote: > I am trying to perform goodness of fit test using R. I am using this > website > http://wiener.math.csi.cuny.edu/Statistics/R/simpleR/stat013.html > for help. However, I am unable to carry out the test successfully. My > code follows. It is taken from the

Re: [R] Problem in performing goodness of fit test in R.

2010-02-14 Thread Bernardo Rangel Tura
On Sun, 2010-02-14 at 12:42 +0500, Faiz Rasool wrote: > I am trying to perform goodness of fit test using R. I am using this website > http://wiener.math.csi.cuny.edu/Statistics/R/simpleR/stat013.html for help. > However, I am unable to carry out the test successfully. My code follows. It > is t

Re: [R] histbackback

2010-02-14 Thread Iasonas Lamprianou
Dear all, does anyone know how I can run the histbackback function from R Commander? I am going to teach this in my class and I hesitate to ask my students to write code Thanks Jason __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman