Re: [R] [FORGED] Tukey Test

2019-01-25 Thread JEFFERY REICHMAN
Rolf

That's it the aricolae "package". Thank you.

Jeff

On Thu, 1/24/19, Rolf Turner  wrote:

 Subject: Re: [FORGED] [R] Tukey Test
 To: reichm...@sbcglobal.net
 Cc: r-help@r-project.org
 Date: Thursday, January 24, 2019, 10:11 PM


 On 1/25/19 4:51 PM, reichm...@sbcglobal.net
 wrote:

 > R-Help
 > 
 >   
 > 
 > There is an R
 library that will perform a Tukey test ...

 

 Surely you mean *package*.

 cheers,

 Rolf Turner

 P.S. You are probably thinking of the agricolae
 *package*.  There is 
 also the TukeyC
 package, which might be relevant.  Likewise the multcomp

 package.  And of course there is the
 TukeyHSD() function in the default 
 package
 "stats".

 GIYF.

 R. T.

 -- 
 Honorary Research Fellow
 Department of Statistics
 University of Auckland
 Phone:
 +64-9-373-7599 ext. 88276

__
R-help@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.


[R] jsonlite

2018-11-06 Thread JEFFERY REICHMAN
r-help Forum

With a bit of r-help yesterday I was able to structure a JSON file such that I 
can read it within the R environment and export what I need except for one list 
object.

So when I run 

location <- json.raw[["favorites"]]
thead(location)

# R returns something like ...

[[1]]
  favoriteValue  favoriteType  Classification
1  23527   https:// .
2  21837   https:// .xyxy

[[2]]
  favoriteValue  favoriteType  Classification
1  25427   https:// .
2  21237   https:// .xyxy
3  21997   https:// .xyxy

[[3]]
  favoriteValue  favoriteType  Classification
1  99427   https:// .


What I want (need) is a data frame that looks like 

favoriteValue
1  23527, 21837
2  25427, 21237, 21997
3  99427

Jeff Reichman

__
R-help@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.


[R] Importing JSON Files

2018-11-05 Thread JEFFERY REICHMAN
r-help Forum

Struggling with importing and creating a data.fram from a JSON file.  I used 
the jsonlite package (fromJSON function) and I can see the resulting table but 
one of the attributes is a list (of lists) So I have something that looks like 
.

favorites (attribute)
list(favoriteValue = c("12345", 23456"), resourceType = c("abc", "def"), 
classification = c("xxx","yyy"))

So when I attempt to create a data.frame R errors out.  I'm assuming it is 
because of the list(s).  Don't know what to do with it (the list).  I need the 
"favoriteValue (s)."

Ultimate I want to run the arules package

Jeff Reichman

__
R-help@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.


[R] Creatng new variable based upon conditions

2018-07-26 Thread JEFFERY REICHMAN
Given something like ...

x <- c(3,2,4,3,5,4,3,2,4,5)
y <- c("A","B","B","A","A","A","A","B","A","B")
xy <- data.frame(x,y)
xy$w <- ifelse(xy$y=="A",xy$w[,x]*10,xy$w[,x]*15 )

want to see

   x y  w
1  3 A 30
2  2 B  30
3  4 B  60
4  3 A  30
5  5 A  50
6  4 A  40
7  3 A  30
8  2 B  30
9  4 A  40
10 5 B  75

but I get NA's

Jeff

__
R-help@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.


[R] Creatng new variable based upon conditions

2018-07-26 Thread JEFFERY REICHMAN
Given

x <- c(3,2,4,3,5,4,3,2,4,5)
y <- c("A","B","B","A","A","A","A","B","A","B")
xy <- cbind(x,y)

and am wanting to create a new variable "w" where if y=="A" then w==x*10 else 
w==x*15 such that I end up with a dataframe

  x   y  w
 [1,] 3 "A" 30
 [2,] 2 "B" 30
 [3,] 4 "B" 60
 [4,] 3 "A" 30
 [5,] 5 "A" 50
 [6,] 4 "A" 40
 [7,] 3 "A" 30
 [8,] 2 "B" 30
 [9,] 4 "A" 40
[10,] 5 "B" 75

ifelse, if then, or for loop

Jeff

__
R-help@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.


Re: [R] Kendall tau a, b, or c

2018-06-15 Thread JEFFERY REICHMAN
Dr. Carlson

Yes, just became aware of the DescTools library after working off Marcs R Code 
last night. Oh well now I have two options. 

Thanks

Jeff

On Fri, 6/15/18, David L Carlson  wrote:

 Subject: RE: [R] Kendall tau a, b, or c
 To: "reichm...@sbcglobal.net" , "'Marc Schwartz'" 

 Cc: "'R-help'" 
 Date: Friday, June 15, 2018, 8:31 AM

 Also look at the DescTools
 package for functions KendallTauA, KendallTauB,
 StuartTauC().  

 
 David L Carlson
 Department of
 Anthropology
 Texas A University
 College Station, TX 77843-4352

 -Original Message-
 From: R-help 
 On Behalf Of Jeff Reichman
 Sent: Thursday,
 June 14, 2018 4:19 PM
 To: 'Marc
 Schwartz' 
 Cc: 'R-help' 
 Subject: Re: [R] Kendall tau a, b, or c

 Marc

 Thank you - that will save me some time.

 Jeff

 -Original Message-
 From: Marc Schwartz 

 Sent: Thursday, June 14, 2018 4:07 PM
 To: JEFFERY REICHMAN 
 Cc: R-help 
 Subject: Re: [R] Kendall tau a, b, or c


 > On Jun
 14, 2018, at 4:04 PM, JEFFERY REICHMAN 
 wrote:
 > 
 > r-help Forum
 > 
 > Is there a function to calculate either
 Kendall tau a, b, or c.  It
 appears the
 Kendall library only calculates tau b.  Just wanted to
 check
 before writing a function to calculate
 the concordant and discordant pairs.
 Then
 its pretty easy.
 > 
 >
 jeff
 > 


 Hi Jeff,

 Take a look at my Github Gist here:

  https://gist.github.com/marcschwartz/3665743

 I have b and c (among other
 measures), and supporting functions to calculate
 concordant and discordant pairs.

 Regards,

 Marc Schwartz

 __
 R-help@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.

__
R-help@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.


[R] Kendall tau a, b, or c

2018-06-14 Thread JEFFERY REICHMAN
r-help Forum

Is there a function to calculate either Kendall tau a, b, or c.  It appears the 
Kendall library only calculates tau b.  Just wanted to check before writing a 
function to calculate the concordant and discordant pairs. Then its pretty easy.

jeff

__
R-help@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.


[R] Bivariate Normal Distribution Plots

2018-04-12 Thread JEFFERY REICHMAN
R-Help

I am attempting to create a series of bivariate normal distributions.  So using 
the mvtnorm library I have created the following code ...

# Standard deviations and correlation
sig_x <- 1
sig_y <- 1
rho_xy <- 0.0

# Covariance between X and Y
sig_xy <- rho_xy * sig_x *sig_y

# Covariance matrix
Sigma_xy <- matrix(c(sig_x ^ 2, sig_xy, sig_xy, sig_y ^ 2), nrow = 2, ncol = 2)

# Load the mvtnorm package
library("mvtnorm")

# Means
mu_x <- 0
mu_y <- 0

# Simulate 1000 observations
set.seed(12345)  # for reproducibility
xy_vals <- rmvnorm(1000, mean = c(mu_x, mu_y), sigma = Sigma_xy) 

# Have a look at the first observations
head(xy_vals)

# Create scatterplot
plot(xy_vals[, 1], xy_vals[, 2], pch = 16, cex = 2, col = "blue", 
 main = "Bivariate normal: rho = 0.0", xlab = "x", ylab = "y")

# Add lines
abline(h = mu_y, v = mu_x)

Problem is this results in sigma(x) = sigma(y), rho=0 and I need or what 
2sigma(x)=sigma(y), rho=0 or 2sigma(y)=sigma(x), rho=0 to elongate the 
distribution.  What I have created creates a circle.  Can I do that within the 
mvtnorm package?

Jeff Reichman

__
R-help@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.


[R] Understanding TS objects

2018-03-13 Thread JEFFERY REICHMAN
R Help Community

I'm trying to understand time series (TS) objects.  Thought I understood but 
recently have run into a series of error messages that I'm not sure how to 
handle.  I have 15 years of quarterly data and I typically create a TS object 
via something like...

data.ts <- ts(mydata, start = 2002, frequency = 4)

this create a matric as opposed to a vector object as I receive a univariate 
error when I try to decompose the data using the STL function

data.stl <- stl(data.ts, "periodic")
Error in stl(data.ts, "periodic") : only univariate series are allowed

ok so

is.vector(data.ts)
[1] FALSE

so to convert to a vector I'll use
data.ts <- as.vector(data.ts)

but then I lose the frequency as the periods as the data becomes frequency = 1
data.ts <- stl <- stl(data.ts, "periodic")
Error in stl(data.ts, "periodic") :
   series is not periodic or has less than two periods.

So am I missing a  parameter or is there a more general/proper way to create a 
time series object? First time I've run into this problem .  I can always 
decompose  via an alternative methods so there are work arounds.  But just 
trying to understand what I'm not doing programmatically at this point.

Jeff Reichman

__
R-help@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.


[R] OpenRTB Data

2018-02-27 Thread JEFFERY REICHMAN
R Forum

Are there any R libraries designed specifically for RTB (Real Time Bidding) 
data?

Jeff Reichman

__
R-help@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.