Questions tagged [r-car]

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

86 questions
0
votes
0 answers

How to plot confidence bounds when comparing two sets of data in r?

I am using qqplot to compare two sets of generated data both fitted to gamma. How can I add the 95% confidence bounds to the plot? x <- rgamma(100,shape=1,scale=1) y <- rgamma(100,shape=1,scale=1.2) library(car) myqq <- function(x, y) { rg <-…
Reza
  • 147
  • 7
0
votes
1 answer

Error downloading and installing R packages - pkbrtest

I attempted to install the car and EZanova package in RStudio, but both of them fail and give the following error: install.packages('car') Warning in install.packages : dependency 'pbkrtest' is not available % Total % Received %…
NikkyVB
  • 31
  • 2
0
votes
2 answers

Trying to recode multiple variables into one?

I'm trying to take three different variables representing partisanship and combine them into one. The data looks like this, where each respondent has data on only one of the three variables as either a 1 or 2: PARTISANSHIP_D PARTISANSHIP_I…
sabrina
  • 43
  • 1
  • 1
  • 8
0
votes
1 answer

qqPlot in a grid

I would like to have some plots arranged in a grid, and one of these plots is a qq-plot using the package car. The following library(car) library(ggplot2) library(gridExtra) n <- 100 df <- data.frame( x=rnorm(n) ) df <- transform(df, y=3*x-1) p <-…
user11634
  • 186
  • 2
  • 12
0
votes
0 answers

Error in vcov.default(mod) : there is no vcov() method for models of class list (changing from type I to type III Sum of Squares)

I am trying to get an ANOVA table for my split-split plot design where it will use type III Sum sq instead of type I. This is what I have done so far; > Attach(Data) > library(car) > options(contrasts = c("contr.sum", "contr.poly")) > mod <-…
Katie
  • 1
  • 1
  • 1
0
votes
2 answers

R - Error in summarise_impl(.data, dots) : Column `center` must be length 1 (a summary value), not 2

I'm trying to calculate the center of each group, by running the calc_center function with dplyr's group_by_ and summarise functions. However, I received an error saying that the column must be 1 column not two. What can I do to bypass it? This is…
user4687733
0
votes
1 answer

Using car:::linearHypothesis() with lme4 models

I want to test whether a coefficient (not the intercept) from a mixed effects model fit using lme4:::lmer() is different from a value other than zero. car:::linearHypothesis() should be able to do this, with p-values and error degrees of freedom…
0
votes
1 answer

How to format labels of points in car::scatter3d?

I'm trying to create a 3D scatter plot of a planetary group, each body properly labeled. The next code creates the plot I need. with(bpmg, { car::scatter3d(x = X, y = Y,z = Z, surface = FALSE, point.col = color, …
0
votes
0 answers

R: Using "otherwise" in RECODE function

I would like to recode numeric values to ordinal variable using 'car' library. However, it seems that I'm unable to use "otherwise" in my recode function. Can I know how to fix the code if I want to code any other values that are not within (0.0 to…
CHONG
  • 373
  • 1
  • 5
  • 13
0
votes
1 answer

Dynamically Generating Plot with scatter3d and Shiny

I'm trying to create a quick app that lets a user select 3 variables and regenerates a 3D scatter with scatter3D. I keep hitting this error when using shiny and I can't see to rectify it. Error: not all arguments have the same length My code also…
dchow
  • 3
  • 2
0
votes
2 answers

How to outlier test for each variable and change?

I want to check the outlier value of each variable in R and change the outlier value of the variable to a specific value. Many people have written in stackoverflow to recommend the outlierTest function in the car package. The outlierTest function,…
이순우
  • 79
  • 1
  • 1
  • 10
0
votes
0 answers

R Multiple Regression - Group Means

How do I get a group mean holding for all other variables (using multiple regression)? I saw an analysis that did this, and am trying to produce something similar for a different set of data. For example, using the Prestige dataset from the car…
psj
  • 23
  • 3
0
votes
1 answer

I want to plot a line over four bargraphs of data in ggplot using geom_line.

I keep getting an error becasue the bargraphs are used for quaterly data and the line is going to be data from the entire year so it will have many points. The only issue is with the geom_line function which I am new to using. The error is -->…
0
votes
1 answer

How to run leveneTest for 5,834 genes at the same time

We have 35 mesenchyaml stem cells (MSCs) single-cell RNA-Seq data, and would like to compare gene expression heterogeneity between different culture conditions (i.e. hypoxia and normoxia). In other words, We would like to identify genes that are…
Gary
  • 1
  • 1
0
votes
3 answers

matching if string values are equal, creating a new string value in new column in R

I am trying to do a kind of 'if' statement in R where I want to find if two values (string) are the same in two different columns. For example, if my Origin and my Destination country are the same, I want to create a new column with Domestic as a…