Jonathan Tian - 2 months ago 7x

R Question

Bascially I want to do a chi square test on a file called output9.csv. There are two columns in the file, I want to pick one of them to do the grubbs analysis on.

1) How do I read the output9.csv into my Rstudio?

2) Do i need to install any packages?

This is what I have so far:

`d <- read.csv('data.csv')`

bytes <- d$Bytes

n outlier

So for this part, what should be inside my bracket,i.e. output9.csv?

`chisq.out.test(mydata)`

Answer

From the documentation of `chisq.out.test`

, you can utilize it to find the **one** outlier of your data considering that you also give the variance. By default, `chisq.out.test`

finds the value with the largest difference from the mean. If the parameter `opposite`

is set to `TRUE`

then the test will go ahead and find the lowest one.

```
library(outliers)
d <- read.csv('data.csv')
test1 <- chisq.out.test(d$Bytes, variance = var(d$Bytes))
#or for opposite
test2 <- chisq.out.test(d$Bytes, variance = var(d$Bytes), opposite = TRUE)
```

Source (Stackoverflow)

Comments