Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
# Chapter 11 problems 5 & 6 ## ch 11 prob 5 > data=read.csv("C:/Users/benny/Downloads/ch11_prob5_data.csv") > View(data) #this data looks stacked already # in tutorial: 'values' = biomass & 'group' = species, 'dataset' = data > data$species=as.factor(data$species) #makes sure the factors are read as distinct factors # for each group n=10, which is small, so we check ANOVA for Normality > shapiro.test(residuals(lm(biomass~species,data))) #IDK WHAT I DID DIFFERENT FROM LAST NIGHT BUT IT WORKS NOW. CODING IS SO # FRUSTRATING ##i checked, i swapped biomass and species # W = 0.96669 pval = 0.2814, not (lessthan/equalto)0.05, therefore pop dist is Normal > bartlett.test(biomass~species,data) #k-sq'd=0.72394 df=3 p-val=0.8676 (>0.05 therefore "insufficient evidence to suggest that the group variances differ", therefore # equal var. ANOVA is appropriate) > summary(aov(biomass~species,data)) #one-way ANOVA test w equal variances # Pr(>F)= 0.00287 > TukeyHSD(aov(biomass~species,data)) ###################################### ## problem 6 - environmental lead ## ###################################### > data=read.csv("C:/Users/benny/Downloads/ch11_prob6_data.csv") > View(data) # 'group' = year, 'values' = lead # > data$year=as.factor(data$year) > shapiro.test(residuals(lm(lead~year,data))) # w=0.86602 p-value=1.197e-13 (super small) > library(psych) > describeBy(data$lead,data$year) > summary(aov(lead~year,data)) #p-val=0.0673 > TukeyHSD(aov(lead~year,data)) ###^^^^^^^^^^^^^^^^^^^^### ## prob 7 - cont. off 6 ## > boxplot(lead~year,data) > kruskal.test(lead~year,data) > install.packages("DescTools") > library(DescTools) > NemenyiTest(x=data$lead,g=data$year,dist = "tukey") #sample sizes (n) are equal, so we use Nemenyi test
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)