bessie green | 6 Jun 01:02
Picon

plotting numeric v. factor variables

Hi.  This seems like it should be really obvious but I haven't been  
able to find a way to do it.

I want to plot some data so that i have 3 levels of a factor variable  
on the x-axis, and then numeric values for the response variable on  
the y-axis.  This would be a plot that is similar to a boxplot with  
the data points showing on it, except without the box and whiskers.   
Is there a plotting function in R to do this?

thanks,
bessie

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bessie Green Markley
M.S. Candidate, Dept. of Biology and Wildlife
Alaska Cooperative Fish and Wildlife Research Unit
Institute of Arctic Biology
Sheenjek trailer, N. Koyukuk Drive
University of Alaska Fairbanks 99775
907-474-1949
Kingsford Jones | 6 Jun 01:45
Picon

Re: plotting numeric v. factor variables

Hi Bessie,

library(lattice)
x <- rep(1:3, each=20)
y <- rnorm(60, x)
x <- c('level1', 'level2', 'level3')[x]
stripplot(y ~ x)

# or perhaps

stripplot(x ~ y, jitter=TRUE)

Kingsford Jones

On Fri, Jun 5, 2009 at 5:02 PM, bessie green<bessie.bug@...> wrote:
> Hi.  This seems like it should be really obvious but I haven't been able to
> find a way to do it.
>
> I want to plot some data so that i have 3 levels of a factor variable on the
> x-axis, and then numeric values for the response variable on the y-axis.
>  This would be a plot that is similar to a boxplot with the data points
> showing on it, except without the box and whiskers.  Is there a plotting
> function in R to do this?
>
> thanks,
> bessie
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Bessie Green Markley
(Continue reading)

Hollister.Jeff | 8 Jun 14:08
Picon

Re: plotting numeric v. factor variables

Bessie,

Another, non-trellis/lattice way to do this is simply with boxplot().

boxplot(response~factor) will plot a boxplot for each of your factor
levels.

For greater control (i.e. removing whiskers, etc.) of boxplot see the
help on boxplot(), bxp(), and boxplot.stats().

Hope this is along the lines of what you were looking for.

Cheers,
Jeff

***************************
Dr. Jeffrey W. Hollister
US EPA
Atlantic Ecology Division
27 Tarzwell Drive
Narragansett, RI 02882
(401) 782-9655
***************************

                                                                                                                                       
  From:       r-sig-ecology-request@...                                                                                      

  To:         r-sig-ecology@...                                                                                              

  Date:       06/06/2009 06:01 AM                                                                                                      
(Continue reading)

Manuel Spínola | 8 Jun 14:13
Picon
Gravatar

Analyzing frequencies in R

Dear list members,

If I have 3 frequencies (3 mutually exclusive groups):

white: 19
black: 43
red: 24

How can I obtain confidence intervals for the proportions, instead of a 
P value from a chisquare test in R?
Or better, how can I assess "effect size" instead of finishing the 
analysis on a P value when analyzing frequencies in R?
Is it possible to obtain standardized Pearson residuals in this situation?
Thank you very much in advance.
Best,

Manuel Spínola

--

-- 
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola@...
mspinola10@...
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
(Continue reading)

Favicon

Re: Analyzing frequencies in R

Dear Manuel,

You can use the Wilson method (with Yates' 
continuity correction) to calculate CIs for 
proportion data.  It's formally described and 
advocated in the following articles:

Newcombe R.G. (1998) Two-Sided Confidence 
Intervals for the Single Proportion: Comparison 
of Seven Methods. Statistics in Medicine 17, 857­872.
Newcombe R.G. (1998) Interval Estimation for the 
Difference Between Independent Proportions: 
Comparison of Eleven Methods. Statistics in Medicine 17, 873­890.

In R, it's implemented in prop.test (which also 
allows two-sample testing of equal proportions).

Cheers,
Phil

At 08:13 AM 6/8/2009, Manuel Spínola wrote:
>Dear list members,
>
>If I have 3 frequencies (3 mutually exclusive groups):
>
>white: 19
>black: 43
>red: 24
>
>How can I obtain confidence intervals for the 
(Continue reading)

mgavil2 | 8 Jun 16:43

comparing results of varpart

Hi all....

I am working in some variation partiting analysis using two different
sets of predictive matrices but with the same set of explanatory
variables. As expected I end up getting the results for % variation
explained by [E], [S], [E+S] and unexplained variation.

The results I get for both predictive matrices are different, but I
wish to statistically compare this, and determine whether the
fractions of [E] and [S] are significantly different for each
predictive matrix, so
% variation explained by [E] in predictive matrix 1 is or is not
statistically different from % variation explained by [E] in
predictive matrix 2
and
% variation explained by [S] in predictive matrix 1 is or is not
statistically different from % variation explained by [S] in
predictive matrix 2

Can anyone help me with an idea as to how to get about this?

Thanks!

Maria Mercedes Gavilanez
Department of Biological Sciences
107 Life Sciences Building
Louisiana State University
Baton Rouge, LA 70803
(225)578-4284
(Continue reading)

sherman | 8 Jun 17:49
Picon
Favicon

Help for the function "Simplex" in R


Hello

I am a new user of  R and try to use Simplex to solve the linear programming
problem.

My problem has 47 variable. 
enj is the vector of object function which is 1*47 dimension
M1 and M2 are 2 1000*48 dimension matrixes. The first column in M1 indicated
b1 and 2-48 for the A1 as following  A1%*%x <= b1
and the same for M2 where b2 is the first column and A2 are the left 2-48
columns A2%*%x >= b2

When i run 
simplex(a=enj,A1=M1[,2:48],b1=t(M1[,1]),A2=M2[,2:48],b2=t(M2[,1]),maxi=TRUE)
i got the error message: Error in as.vector(X) %*% t(as.vector(Y)) :
non-conformable arguments

Is anyone knows what is wrong in my statement? 

Thank you.

--

-- 
View this message in context: http://n2.nabble.com/Help-for-the-function-%22Simplex%22-in-R-tp3043777p3043777.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.
Meche Gavilanes | 9 Jun 01:17
Picon

comparing results of var part

Hi all....

I am working in some variation partiting analysis using two different
sets of predictive matrices but with the same set of explanatory
variables. As expected I end up getting the results for % variation
explained by [E], [S], [E+S] and unexplained variation.

The results I get for both predictive matrices are different, but I
wish to statistically compare this, and determine whether the
fractions of [E] and [S] are significantly different for each
predictive matrix, so
% variation explained by [E] in predictive matrix 1 is or is not
statistically different from % variation explained by [E] in
predictive matrix 2
and
% variation explained by [S] in predictive matrix 1 is or is not
statistically different from % variation explained by [S] in
predictive matrix 2

Can anyone help me with an idea as to how to get about this?

Thanks!

Maria Mercedes Gavilanez
Department of Biological Sciences
107 Life Sciences Building
Louisiana State University
Baton Rouge, LA 70803
(225)578-4284

(Continue reading)

Struve, Juliane | 11 Jun 18:50
Picon

include Time in as.ltraj()

Dear list,

I am trying to create an ltraj object from but can't get the date - time information right.

All_1646=read.table("All_1646.csv", sep=",",header=TRUE,as.is=TRUE )
All_1646$Date=as.Date(All_1646$Date)
attr(All_1646, "projection") <- c("LL")
All_1646<- convUL(All_1646,km=FALSE)
All_1646$Datime <-as.POSIXct(paste(All_1646$Date, All_1646$Time), "%Y/%m/%d %H:%M:%S")
ltr1646 <- as.ltraj(All_1646, date=All_1646$Datime, id=All_1646$"Fish_ID", typeII = TRUE)

I get an error message "Error in as.ltraj(All_1646, date = All_1646$Datime, id = All_1646$Fish_ID,  :
non unique dates for a given burst".

However, the Datime column does include the time of observation as shown below. What am I doing wrong ?

Many thanks for your time,

Juliane

Datime
2006-08-18 08:48:59

	[[alternative HTML version deleted]]
Erika Mudrak | 11 Jun 23:40
Picon
Favicon

how to do ChiX2 goodness of fit tests on weird distributions?

Hello everyone-

I have several sets of data that I fit (using MLE) to several uncommon distributions (betabinomial,
zero-inflated negative binomial, zero-inflated betabinomial, zero-inflated binomial etc...). 

I used dzinbinom from the emdbook package, corresponding to Benjamin Bolker's book, Ecological Models
and Data in R, and dzibinom and dzibb as developed on page 285-286 of this book. 

I have compared them using AIC values (with AICtab from the bbmle package), but I would still like to do a
goodness of fit test on the "winner" to see if it is a reasonable distribution. 

goodfit() from vcd can only take poisson, binomial, and nbinomial. 

I would like to use chisq.test, but I am having trouble coming up with the reference distribution.

I followed an example on page 287 of this book where the reference distribution is calculated using dzibb,
and then used it in the slot for p, a vector of probabilities: 

ZIBBprob=dzibb(1:size, prob=blurf1, theta=blurf2, size=blurf3, zprob=blurf4)
chisq.test(tabulate(obs),p=ZIBBprob)

My problem is that the ZIBBprob vector does not add up to 1...  Is this because I am mis-using dzibb?  

Does anyone have any suggestions on how I can perform GOF tests on these weirdo distributions?

Thanks

Erika Mudrak

-------------------------------------------
(Continue reading)


Gmane