Questions tagged [r-car]

car (an R package) means Companion to Applied Regression. Use with the [r] tag

86 questions
15
votes
4 answers

How to do a Tukey HSD test with the Anova command (car package)

I'm dealing with an unbalanced design/sample and originally learned aov(). I know now that for my ANOVA tests I need to use the Type III Sum of Squares which involves using fitting using lm() rather than using aov(). The problem is getting post-hoc…
leighadlr
  • 159
  • 1
  • 1
  • 5
8
votes
2 answers

package car unable to load, wrong version of nlme

When I try to load the 'car' package I get this error: library(car) Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'nlme' 3.1-122 is already loaded, but >= 3.1.123 is required Error: package or…
Jon Sjöberg
  • 159
  • 1
  • 7
7
votes
2 answers

How to calculate the area of ellipse drawn by ggplot2?

In ggplot2, after I drawing the ellipse plot using stat_ellipse, is there any way to calculate the area of this ellipse? Here is the code and the plot: library(ggplot2) set.seed(1234) x <- rnorm (1:1000) y <- rnorm (1:1000) data <- cbind(x, y) data…
Ping Tang
  • 415
  • 1
  • 9
  • 20
7
votes
5 answers

Unable to install package car

I am using R version 3.2.3 in Linux mint 17.3 64 bit. I was trying to install the package "car" with dependencies=TRUE, but the installation failed with the following error messages: > warnings() Warning messages: 1: In install.packages("car",…
Bishwarup Paul
  • 361
  • 1
  • 4
  • 12
7
votes
3 answers

R recode variable - unexpected INCOMPLETE_STRING

I am trying to recode a factor variable in R and using the following code: library(car) napier_captureComplexity=recode(napier$a_SpatialConnectivity,"'1 - Very simple and clear: no diagrams, single sheets'=1;'2 - Reasonably simple: some simple…
user3746990
  • 71
  • 1
  • 1
  • 2
6
votes
3 answers

Obtain vertices of the ellipse on an ellipse covariance plot (created by `car::ellipse`)

By following this post one can draw an ellipse with a given shape matrix (A): library(car) A <- matrix(c(20.43, -8.59,-8.59, 24.03), nrow = 2) ellipse(c(-0.05, 0.09), shape=A, radius=1.44, col="red", lty=2, asp = 1) Now how to get the major/minor…
Janak
  • 653
  • 7
  • 25
6
votes
1 answer

R- Partial eta squared for repeated measures ANOVA (car package)

I have a 2-way repeated measures design (3 x 2), and I would like to get figures out how to calculate effect sizes (partial eta squared). I have a matrix with data in it (called a) like so (repeated measures) A.a A.b B.a …
luke123
  • 631
  • 3
  • 9
  • 15
5
votes
6 answers

Car package not found by R (failed to load)

I am am trying to load a simple dataset using: library(car) but I get the following error: Error in library("car") : there is no package called 'car' Does anyone have an idea why this happens and how to solve it?
fabiof
  • 89
  • 1
  • 1
  • 6
5
votes
1 answer

Adjust degrees of freedom for sphericity correction in repeated measure Anova from car package

I am running a repeated measures ANOVA using the car package. Which works fine and returns an output similar to this: Univariate Type III Repeated-Measures ANOVA Assuming Sphericity SS num Df Error SS den Df F Pr(>F) …
JereB
  • 137
  • 8
4
votes
3 answers

How to recode a variable to numeric?

> library(car) > df = data.frame(value=c('A', 'B', 'C', 'A')) > foo = recode(df$value, "'A'=1; 'B'=2; 'C'=3;", as.numeric.result=TRUE) > mean(foo) [1] NA Warning message: In mean.default(foo) : argument is not numeric or logical: returning NA >…
dfrankow
  • 20,191
  • 41
  • 152
  • 214
4
votes
1 answer

R: Error while recoding variables using car::recode function

I frequently use 'recode' function in library(car) to recode levels in variables. My code was working fine up until today, but now it is throwing me error. Nothing's changed in df etc, not sure what's going on. May be somebody could enlighten me! My…
Rudr
  • 387
  • 4
  • 20
4
votes
1 answer

Multiple Comparison Post-Hoc test for Levene's test

I'd like to do a pairwise comparison post-hoc test on Levene's test in R. I know how to do it in SAS using PROC GLM but I can't seem to figure out how to do it in R. Does anyone have any idea? In the example below I'd like to be able to test the…
Nathan
  • 323
  • 3
  • 13
4
votes
1 answer

multi-panel scatterplot in Cars package

I'm trying to make a 2 panel figure in RStudio. Simple enough usually: par(mfrow=c(1,2)) #1*2 plotting window However, when I make the plot using the scatterplot() function from the car package it seems to override this division of the plotting…
Jesse001
  • 924
  • 1
  • 13
  • 37
4
votes
3 answers

recode (car package) function - recodes argument and equals sign

I would like know whether it is permitted to use an equals (=) sign in the recodes parameter of the recode function in the car package? For instance, the following fails: library(car) n <- c(0, 10, 20, 21, 60, 70) r <- recode(n, " 0:20 = '<= 20' ;…
user6155802
4
votes
1 answer

R, car package unable to load

I'm new with R, and I'm having some trouble loading the car library. I use Windows 8.1 (64 bit) and i'm working in 32 bit R environment. I downloaded the library just fine, but when i try to load the car library using library(car) the message i get…
Tamara Sternlieb
  • 43
  • 1
  • 1
  • 4
1
2 3 4 5 6