User Tools

Site Tools


b:head_first_statistics:visualization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
b:head_first_statistics:visualization [2025/09/03 08:41] – [box plot] hkimscilb:head_first_statistics:visualization [2025/09/08 08:22] (current) – [Histogram Modality] hkimscil
Line 91: Line 91:
 </code> </code>
 {{:b:head_first_statistics:pasted:20240904-082258.png}} {{:b:head_first_statistics:pasted:20240904-082258.png}}
 +
 +<code>
 +dat.iq <- rnorm(1000, 100, 15)
 +head(dat.iq)
 +tail(dat.iq)
 +head(dat.iq, n=12)
 +tail(dat.iq, n=12)
 +
 +mean(dat.iq)
 +sd(dat.iq)
 +
 +hist(dat.iq)
 +hist(dat.iq, breaks=30, col='lightblue')
 +
 +set.seed(101)
 +dat.iq <- rnorm(1000, 100, 15)
 +head(dat.iq)
 +tail(dat.iq)
 +head(dat.iq, n=12)
 +tail(dat.iq, n=12)
 +
 +mean(dat.iq)
 +sd(dat.iq)
 +
 +hist(dat.iq)
 +hist(dat.iq, breaks=30, col='lightblue')
 +</code>
 ====== Scatter plot ====== ====== Scatter plot ======
 <code> <code>
Line 251: Line 278:
 <WRAP clear/> <WRAP clear/>
  
 +====== Histogram Modality======
 <WRAP column half> <WRAP column half>
 +Unimodal 
 <code> <code>
 ### unimodal data  ### unimodal data 
Line 271: Line 300:
 <WRAP clear/> <WRAP clear/>
  
 +Bimodal distribution
 <WRAP column half> <WRAP column half>
 <code> <code>
Line 292: Line 321:
 </WRAP> </WRAP>
 <WRAP clear/> <WRAP clear/>
- 
  
 <WRAP column half> <WRAP column half>
Line 303: Line 331:
 # Parameters for the second normal distribution (Mode 2) # Parameters for the second normal distribution (Mode 2)
 m.2 <- 100 m.2 <- 100
-sd.2 <- 8+sd.2 <- 15
  
 m.3 <- 160 m.3 <- 160
Line 311: Line 339:
 prop.1 <- 0.3 prop.1 <- 0.3
 # Mixing proportion for Mode 2 # Mixing proportion for Mode 2
-prop.2 <- 0.# This is 1 - prop1+prop.2 <- 0.# This is 1 - prop1
 # Mixing proportion for Mode 2 # Mixing proportion for Mode 2
-prop.3 <- 0.# This is 1 - prop1 +prop.3 <- 1.# This is 1 - prop1
  
 # Number of samples to generate # Number of samples to generate
Line 347: Line 374:
 </WRAP> </WRAP>
 <WRAP column half> <WRAP column half>
-{{:b:head_first_statistics:pasted:20250903-082247.png}}+{{:b:head_first_statistics:pasted:20250908-082219.png}}
 </WRAP> </WRAP>
 <WRAP clear/> <WRAP clear/>
Line 353: Line 380:
  
 ====== box plot ====== ====== box plot ======
 +<WRAP column half>
 <code> <code>
 # Boxplot of MPG by Car Cylinders # Boxplot of MPG by Car Cylinders
Line 361: Line 388:
     ylab="Miles Per Gallon")     ylab="Miles Per Gallon")
 </code> </code>
-{{:c:ps1-1:2019:pasted:20190909-111438.png}}+</WRAP>
  
 +<WRAP column half>
 +{{:c:ps1-1:2019:pasted:20190909-111438.png}}
 +</WRAP>
 +<WRAP clear/>
 ====== see also ====== ====== see also ======
 https://r-graph-gallery.com/ https://r-graph-gallery.com/
  
b/head_first_statistics/visualization.1756856464.txt.gz · Last modified: 2025/09/03 08:41 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki