[R] carolina function help

David L Carlson dcarlson at tamu.edu
Wed Jan 27 16:19:18 CET 2016


In addition to John's advice, we need to know what package you are using and what error messages you are getting since "perform correctly" is pretty vague. I'm guessing you are using package agricolae. Assuming you have installed the package and loaded it, your request for working code is included on the manual page for function carolina() as the second example:

> library(agricolae)         # load package
> ?carolina                  # to get the manual page
> example(carolina)          # to run the examples
# ============== running examples =======================
caroln> library(agricolae)

caroln> data(DC)

caroln> carolina1 <- DC$carolina1

caroln> # str(carolina1)
caroln> output<-carolina(model=1,carolina1) # <====== Model 1
Response(y):  yield 

Analysis of Variance Table

Response: y
                            Df  Sum Sq Mean Sq F value    Pr(>F)
set                          1  0.5339  0.5339  7.2120 0.0099144
set:replication              2  2.9894  1.4947 20.1914 4.335e-07
set:male                     4 22.1711  5.5428 74.8743 < 2.2e-16
set:male:female              6  4.8250  0.8042 10.8630 1.311e-07
set:replication:male:female 10  3.2072  0.3207  4.3325 0.0002462
Residuals                   48  3.5533  0.0740                  
                               
set                         ** 
set:replication             ***
set:male                    ***
set:male:female             ***
set:replication:male:female ***
Residuals                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

CV: 8.286715    Mean: 3.283333 

caroln> output[][-1]
$var.m
[1] 0.3948843

$var.f
[1] 0.08057407

$var.A
[1] 1.579537

$var.D
[1] -1.257241

caroln> carolina2 <- DC$carolina2

caroln> # str(carolina2)
caroln> majes<-subset(carolina2,carolina2[,1]==1)

caroln> majes<-majes[,c(2,5,4,3,6:8)]

caroln> output<-carolina(model=2,majes[,c(1:4,6)]) # <==== Model 2
Response(y):  yield 

Analysis of Variance Table

Response: y
                Df  Sum Sq Mean Sq F value    Pr(>F)    
set              1  847836  847836 45.6296 1.097e-09 ***
set:replication  4  144345   36086  1.9421  0.109652    
set:male         8  861053  107632  5.7926 5.032e-06 ***
set:female       8  527023   65878  3.5455  0.001227 ** 
set:male:female 32  807267   25227  1.3577  0.129527    
Residuals       96 1783762   18581                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

CV: 19.08779    Mean: 714.1301 

caroln> output[][-1]
$var.m
[1] 2746.815

$var.f
[1] 1355.024

$var.mf
[1] 2215.415

$var.Am
[1] 10987.26

$var.Af
[1] 5420.096

$var.D
[1] 8861.659

caroln> carolina3 <- DC$carolina3

caroln> # str(carolina3)
caroln> output<-carolina(model=3,carolina3)  # <==== Model 3
Response(y):  yield 

Analysis of Variance Table

Response: y
                Df Sum Sq Mean Sq F value   Pr(>F)   
set              3  2.795 0.93167  1.2784 0.300965   
set:replication  4  3.205 0.80125  1.0995 0.376215   
set:female       4  1.930 0.48250  0.6621 0.623525   
set:male        12 20.970 1.74750  2.3979 0.027770 * 
set:female:male 12 27.965 2.33042  3.1978 0.005493 **
Residuals       28 20.405 0.72875                    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

CV: 21.95932    Mean: 3.8875 

caroln> output[][-1]
$var.mi
[1] 0.8008333

$var.m
[1] 0.2546875

$var.A
[1] 1.01875

$var.D
[1] 1.601667


-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352



-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of John Kane
Sent: Wednesday, January 27, 2016 5:00 AM
To: Huffman Ryan; r-help at r-project.org
Subject: Re: [R] carolina function help

Hi Ryan,
No idea about the problem but have a look at these links for some suggestions on the type of detail that you might want to supply to help people understand the issue and help.

The more specific details of your problem that you can supply the easier it is to make suggestions. Usually supplying some sample data using the dput() function (See ?dput) is most helpful.

Please have a look at
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html

John Kane
Kingston ON Canada


> -----Original Message-----
> From: rhuffman at iastate.edu
> Sent: Tue, 26 Jan 2016 15:36:46 -0600
> To: r-help at r-project.org
> Subject: [R] carolina function help
> 
> I am looking  for advice from those who have used the carolina function,
> notably carolina model=2 for a North Carolina Design II analysis. I have
> having difficulty getting the function to perform correctly and would
> like
> an example of a code that someone has gotten to work.  Thanks
> 
> --
> Ryan Huffman
> PhD Candidate
> Vice President of MCDB-GSO
> GPSS Senator
> G426 Agronomy Hall
> rhuffman at iastate.edu
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list