Comments on Learning Statistics with R

So I found a textbook for learning both elementary statistics much of which i knew but hadnt read a textbook about, and for learning R.

health.adelaide.edu.au/psychology/ccs/teaching/lsr/ book is free legally

www.goodreads.com/book/show/18142866-learning-statistics-with-r

Numbers refer to the page number in the book. The book is in an early version (“0.4″) so many of these are small errors i stumbled upon while going thru virtually all commands in the book in my own R window.

 

120:

These modeOf() and maxFreq() does not work. This is because the afl.finalists is a factor and they demand a vector. One can use as.vector() to make them work.

 

131:

Worth noting that summary() is the same as quartile() except that it also includes the mean.

 

151:

Actually, the output of describe() is not telling us the number of NA. It is only because the author assumes that there are 100 total cases that he can do 100-n and get the number of NAs for each var.

 

220:

The cakes.Rdata is already transposed.

 

240:

as.logical also converts numeric 0 and 1 to F and T. However, oddly, it does not understand “0” and “1”.

 

271:

Actually P(0) is not equivalent with impossible. See: en.wikipedia.org/wiki/Almost_surely

 

278:

Actually 100 simulations with N=20 will generally not result in a histogram like the above. Perhaps it is better to change the command to K=1000. And why not add hist() to it so it can be visually compared to the theoretic one?

 


>
hist(rbinom( n = 1000, size = 20, prob = 1/6 ))

298:

It would be nice if the code for making these simulations was shown.

 

299:

“This is just bizarre: σ ˆ 2 is and unbiased estimate of the population variance”

 

Typo.

 

327:

Typo in Figure 11.6 text. “Notice that when θ actually is equal to .05 (plotted as a black dot)”

 

344:

Typo.

“That is, what values of X2 would lead is to reject the null hypothesis.”

 

379:

It is most annoying that the author doesn’t write the code for reproducing his plots. I spent 15 minutes trying to find a function to create histplots by group.

 

385:

Typo.

 

“It works for t-tests, but it wouldn’t be meaningful for chi-square testsm F -tests or indeed for most of the tests I talk about in this book.”

 

391:

“we see that it is 95% certain that the true (population-wide) average improvement would lie between 0.95% and 1.86%.”

 

This wording is dangerous because there are two interpretations of the percent sign. In the relative sense, they are wrong. The author means absolute %’s.

 

400:

The code has +’s in it which means it cannot just be copied and runned. This usually isn’t the case, but it happens a few times in the book.

 

408+410:

In the description of the test, we are told to tick when the values are larger than. However, in the one sample version, the author ticks when the value is equal to. I guess this means that we tick when it is equal to or larger than.

 

442:

This command doesn’t work because the dataframe isn’t attached as the author assumes.

> mood.gain <- list( placebo, joyzepam, anxifree)

 

457:

First the author says he wants to use the R^2 non-adjusted, but then in the text he uses the adjusted value.

 

464:

Typo with “Unless” capitalized.

 

493:

“(3.45 for drug and 0.92 for therapy),”

He must mean .47 for therapy. .92 is the number for residuals.

 

497:

In the alternates hypothesis, the author uses “u_ij” instead of “u_rc” which is used in the null-hypothesis. I’m guessing the null-hypothesis is right.

 

514:

As earlier, it is ambiguous when the author talks about increases in percent. It could be relative or absolute. Again in this case it is absolute. The author should use %point or something to avoid confusion.

 

538:

Quoting

 

“I find it amusing to note that the default in R is Type I and the default in SPSS is Type III (with Helmert contrasts). Neither of these appeals to me all that much. Relatedly, I find it depressing that almost nobody in the psychological literature ever bothers to report which Type of tests they ran, much less the order of variables (for Type I) or the contrasts used (for Type III). Often they don’t report what software they used either. The only way I can ever make any sense of what people typically report is to try to guess from auxiliary cues which software they were using, and to assume that they never changed the default settings. Please don’t do this… now that you know about these issues, make sure you indicate what software you used, and if you’re reporting ANOVA results for unbalanced data, then specify what Type of tests you ran, specify order information if you’ve done Type I tests and specify contrasts if you’ve done Type III tests. Or, even better, do hypotheses tests that correspond to things you really care about, and then report those!”

 

An exmaple of the necessity of open methods along with open data. Science must be reproducible. The best is to simply share the exact source code to the the analyses in a paper.

Review: Understanding human history (Michael H. Hart)

www.goodreads.com/book/show/1737823.Understanding_Human_History

gen.lib.rus.ec/search.php?req=Understanding+Human+History&open=0&view=simple&column=def

I think Elijah mentioned this book somewhere. I can’t find where.

The basic idea of the book is to write a history book that does take known population differences into account. Normal history books don’t do that. Generally, the chapters are only very broad sketches of some period or pattern. Much of it is plausible but not too well-argued. If one looks in the references for sources given, one can see that a large number of them are to some 1985 edition of Encyclopedia Britannica. Very odd. This is a post-Wikipedia age, folks. Finding primary literature on some topic is really easy. Just search Wikipedia, read its sources. The book is certainly flawed due to the inadequate referencing of claims. Many claims that need references don’t have any either.

On the positive side, there are some interesting ideas in it. The simulations of population IQ’s in different regions is clearly a necessary beginning of a hard task.

Probably you should only read this book if you are interested in history, population genetics and differential psychology beyond a pop science superficial level.

The author is an interesting fellow. en.wikipedia.org/wiki/Michael_H._Hart

 

Comment on CPGGrey’s new video on the future of automatization

Posted on reddit.

 

This is your best film yet, and that says something.

For automatization for clinical decisions, it has been known for decades that simple algorithms are better than humans. This has so far not been put to much practice, but it will eventually. See review article: Grove, W. M., Zald, D. H., Lebow, B. S., Snitz, B. E., & Nelson, C. (2000). Clinical versus mechanical prediction: a meta-analysis.[1] Psychological assessment, 12(1), 19.

There is only one temporary solution for this problem. It is to make humans smarter. I say temporary because these new smarter humans will quickly make robots even smarter and so they can replace even the new smarter humans.

How to make humans more intelligent? The only effective way to do that is to use applied human genetics aka. eugenics. This is because general intelligence (g-factor) is about 80% heritable in adults (and pretty much everything else is also moderately to highly heritable). There are two things we must do: 1) Find the genes for g. This effort is underway and we have found a few SNPs so far.[1-2] It is estimated that there are about 1k-10k genes for g. 2) Find out how to apply this genetic knowledge in practice to make both existing humans and the new ones smarter. The first effective technology for this is embryo selection[2] . Perhaps CRISPR[3] can work for existing humans.

  1. Rietveld, C.A., Medland, S.E., Derringer, J., Yang, K., Esko, T., et al. (2013). GWAS of 126,559 individuals identifies genetic variants associated with educational attainment. Science 340: 1467-1471.
  2. Ward, M.E., McMahon, G., St Pourcain, B., Evans, D.M., Rietveld, C.A., et al. (2014) Genetic Variation Associated with Differential Educational Attainment in Adults Has Anticipated Associations with School Performance in Children. PLoS ONE 9(7): e100248. doi:10.1371/journal.pone.0100248

So that idea I had about using genetically informed dating sites…

Previous post: emilkirkegaard.dk/en/?p=4103

Prediction: Good dating sites of the future will use genomic data to select partners with matching MHC. The idea is obvious. Genomic sequencing prices will fall. People will have copies of their data. These can be uploaded to dating sites. Dating sites can extract the info about MHC (and whatever else!) from the data, and match people accordingly. Perhaps people will extract the MHC part of the genome and only upload that, to avoid giving more information than necessary. Altho other info can be used to match as well.

 

It’s here already: singldout.com/#howitworks

Bouchard’s new review paper on Genes, Evolution, Intelligence is excellent!

Seriously. Read it.

Behavior Genetics (Impact Factor: 2.61). 03/2014; DOI: 10.1007/s10519-014-9646-x

Source: PubMed

ABSTRACT I argue that the g factor meets the fundamental criteria of a scientific construct more fully than any other conception of intelligence. I briefly discuss the evidence regarding the relationship of brain size to intelligence. A review of a large body of evidence demonstrates that there is a g factor in a wide range of species and that, in the species studied, it relates to brain size and is heritable. These findings suggest that many species have evolved a general-purpose mechanism (a general biological intelligence) for dealing with the environments in which they evolved. In spite of numerous studies with considerable statistical power, we know of very few genes that influence g and the effects are very small. Nevertheless, g appears to be highly polygenic. Given the complexity of the human brain, it is not surprising that that one of its primary faculties-intelligence-is best explained by the near infinitesimal model of quantitative genetics.

Genes, Evolution and Intelligence

A troublesome inheritance (Nicholas Wade)

This book is very popsci and can be read in 1 day for any reasonably fast reader. It doesnt contain much new information to anyone who has read a few books on the topic. As can be seen below, it has a lot of nonsense/errors since clearly the author is not used to this area of science. It is not recommended except as a light introduction to people with political problems with these facts.

gen.lib.rus.ec/book/index.php?md5=7a48b9a42d89294ca1ade9f76e26a63c

www.goodreads.com/book/show/18667960-a-troublesome-inheritance?from_search=true

 

But  a  drawback  o f  the  system  is  its  occasional  drift  toward
extreme  conservatism.  Researchers  get  attached  to  the  view  of their
field  they  grew  up  with  and,  as  they  grow  older,  they  may  gain  the
influence  to thwart change.  For  50  years  after it was  first proposed,
leading geophysicists  strenuously resisted the idea that the continents
have  drifted  across  the  face  of  the  globe.  “Knowledge  advances,
funeral  by funeral,”  the economist Paul  Samuelson  once  observed.

 

Wrong quote origin. en.wikiquote.org/wiki/Max_Planck

>A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it.

 

-

Academics, who are obsessed with intelligence, fear the discovery
of  a  gene  that  will  prove  one  major  race  is  more  intelligent  than
another.  But  that  is  unlikely  to  happen  anytime  soon.  Although
intelligence has a genetic basis, no genetic variants that enhance intel­
ligence  have  yet  been  found.  The  reason,  almost  certainly,  is  that
there  are  a  great  many  such  genes,  each  of  which  has  too  small  an
effect  to  be  detectable  with  present  methods.8  If  researchers  should
one  day  find  a  gene  that  enhances  intelligence  in  East  Asians,  say,
they can  hardly argue on that  basis that East Asians are more  intelli­
gent than other races, because hundreds of similar genes remain to be
discovered  in  Europeans  and  Africans.
Even  if  all  the  intelligence-enhancing  variants  in  each  race  had
been identified, no one would try to compute intelligence on the basis
of genetic  information:  it would  be  far easier  just to  apply  an  intelli­
gence test.  But IQ  tests already  exist, for what  they may  be  worth.

 

We have found a number of SNPs already. And we have already begun counting them in racial groups. See e.g.: openpsych.net/OBG/2014/05/opposite-selection-pressures-on-stature-and-intelligence-across-human-populations/

 

-

 

It s social behavior that is of relevance for understanding pivotal—
and otherwise imperfectly explained— events in history and econom­
ics.  Although  the  emotional  and  intellectual  differences  between  the
world’s peoples  as  individuals are slight enough,  even a  small  shift in
social  behavior  can  generate  a  very  different  kind  of society.  Tribal
societies, for instance, are organized on the basis of kinship and differ
from  modern  states  chiefly  in  that  people’s  radius  of trust  does  not
extend too far beyond the family and tribe.  But in this small variation
is  rooted  the  vast  difference  in  political  and  economic  structures
between tribal and modern societies. Variations in another genetically
based behavior, the readiness to punish those who violate social rules,
may explain why  some societies  are  more conformist than others.

 

See: www.goodreads.com/book/show/3026168-the-expanding-circle

 

-

 

The  lure  of  Galton’s  eugenics  was  his  belief  that  society  would
be  better  off  if  the  intellectually  eminent  could  be  encouraged  to
have  more  children.  W hat  scholar  could  disagree  with  that?  More
of  a  good  thing  must  surely  be  better.  In  fact  it  is  far  from  certain
that  this  would  be  a  desirable  outcome.  Intellectuals  as  a  class  are
notoriously  prone  to  fine-sounding  theoretical  schemes  that  lead
to  catastrophe,  such  as  Social  Darwinism,  Marxism  or  indeed
eugenics.
By  analogy  with  animal  breeding,  people  could  no  doubt  be
bred,  if it were ethically acceptable, so  as to  enhance  specific desired
traits.  But  it  is  impossible  to  know  what  traits would  benefit  society
as a whole. The eugenics program, however reasonable it might seem,
was  basically incoherent.

 

Obviously wrong.

 

-

 

The  principal  organizer  of  the  new  eugenics  movement  was
Charles  Davenport.  He  earned  a  doctorate  in  biology  from  Harvard
and  taught  zoology  at  Harvard,  the  University  of  Chicago,  and  the
Brooklyn  Institute  of  Arts  and  Sciences  Biological  Laboratory  at
Cold  Spring  Harbor  on  Long  Island.  Davenport’s  views  on  eugenics
were  motivated  by  disdain  for  races  other  than  his  own:  “Can  we
build a  wall high  enough around this country so as to keep  out these
cheaper  races,  or will  it  be  a  feeble  dam  .  .  .  leaving it to  our  descen­
dants to abandon  the country to the  blacks,  browns  and  yellows and
seek  an  asylum in New  Zealand?”  he wrote.9

 

Well, about that… In this century europeans will be <50% in the US. I wonder if the sociologists will then stop talking about minority, as if that somehow makes a difference.

 

-

 

One  of  the  most  dramatic  experiments  on  the  genetic  control  of
aggression was performed by the Soviet scientist Dmitriy Belyaev. From
the same population of Siberian gray rats he developed two strains, one
highly sociable  and  the  other  brimming with  aggression.  For  the tame
rats, the parents of each generation were chosen simply by the criterion
of how well they tolerated  human presence.  For the  ferocious  rats, the
criterion  was  how adversely they reacted  to people.  After many gener­
ations of breeding,  the  first strain was  now so tame that when visitors
entered  the  room  where  the  rats  were  caged,  the  animals  would  press
their  snouts  through  the  bars to  be  petted.  The  other  strain  could  not
have  been  more  different.  The  rats  would  hurl  themselves  screaming
toward  the  intruder,  thudding  ferociously  against  the  bars  of  their
cage.12

 

Didnt know this one. The ref is:

N icholas  Wade,  “N ice  R a ts,  N asty  R a ts:  Maybe  I t ’s  All  in  the  G en es,”
N ew  York  Tim es, Ju ly  2 5 ,  2 0 0 6 ,  www.nytimes.com/2006/07/25/health/
25 ra ts.h tm l?p a g ew a n ted = a ll& _ r=0  (accessed  Sept.  2 5 ,  2 0 1 3 )

 

-

 

Rodents and humans use many of the same genes and  brain regions
to control  aggression.  Experiments with  mice  have  shown that a  large
number of genes are involved in the trait, and the same is certainly true
of  people.  Comparisons  of  identical  twins  raised  together  and  sepa­
rately  show  that  aggression  is  heritable.  Genes  account  for  between
3 7%  and 72%  of the heritability, the variation  of the trait in a  popula­
tion, according to various studies.  But very few of the genes that under­
lie  aggression  have  yet  been  identified,  in  part  because  when  many
genes control  a  behavior,  each  has  so  small  an  effect  that  it  is  hard  to
detect.  Most  research  has  focused  on  genes  that  promote  aggression
rather than those at the other end of the  behavioral  spectrum.

 

This sentence is nonsensical.

 

-

 

Standing  in  sharp  contrast  to  the  economists’  working  assumption
that  people  the  world  over  are  interchangeable  units  is  the  idea  that
national  disparities  in  wealth  arise  from  differences  in  intelligence.
The possibility should  not be  dismissed  out of hand:  where  individu­
als are concerned,  IQ  scores do correlate,  on average,  with economic
success, so  it is not unreasonable to inquire if the same  might  be true
of countries.

 

Marked sentence is nonsensical.

 

-

 

Turning to economic indicators, they find that national  IQ scores
have an extremely high correlation  (83%)  with economic growth  per
capita  and  also  associate  strongly  with  the  rate  of economic  growth
between  1950  and  1 9 9 0  (64%  correlation).44

 

More conceptual confusion.

 

-

 

And  indeed  with  Lynn  and  Vanhanen’s correlations,  it  is  hard to
know  which  way  the  arrow  of  causality  may  be  pointing,  whether
higher  IQ  makes  a  nation  wealthier  or  whether  a  wealthier  nation
enables  its  citizens  to  do  better  on  IQ  tests.  The  writer  Roy  Unz  has
pointed out from  Lynn and Vanhanen’s own data examples  in  which
IQ  scores  increase  10  or more points  in  a generation  when  a  popula­
tion  becomes  richer,  showing  clearly  that  wealth  can  raise  IQ
scores  significantly.  East  German  children  averaged  90  in  1 9 6 7  but
99  in  1984.  In  West  Germany,  which  has  essentially the  same  popu­
lation,  averages  range  from  99  to  107.  This  17  point  range  in  the
German  population,  from  90  to  107,  was  evidently  caused  by  the
alleviation  of poverty,  not genetics.

 

Ron Unz, the cherry picker. conservativetimes.org/?p=11790

 

-

 

East  Asia  is  a  vast counterexample to the  Lynn/Vanhanen  thesis.
The  populations  of China, Japan  and Korea  have consistently  higher
IQs  than  those  of Europe  and  the  United  States,  but  their  societies,
despite  their  many  virtues,  are  not  obviously  more  successful  than
those of Europe and  its outposts. Intelligence can’t hurt, but it doesn’t
seem  a  clear  arbiter  of  a  population’s  economic  success.  W hat  is  it
then  that determines  the  wealth  or poverty of nations?

 

No. But it does disprove the claim that IQs are just GDPs. The oil states have low IQs and had that both before and after they got rich on oil, and will have in the future when they run out of oil again. Money cannot buy u intelligence (yet).

 

-

 

From  about  9 0 0  a d   to  1700  a d ,  Ashkenazim  were  concentrated
in  a  few  professions,  notably  moneylending  and  later  ta x  farming
(give  the prince  his  money  up  front,  then  extract the  taxes  due  from
his  subjects).  Because  of  the  strong  heritability  of  intelligence,  the
Utah team calculates that 20 generations, a mere 5 0 0 years, would be
sufficient for Ashkenazim to have developed an  extra  16 points of IQ
above that of Europeans. The Utah team assumes that the heritability
of  intelligence  is  0 .8 ,  meaning  that  8 0 %  of the  variance,  the  spread
between high and low values in a population, is due to genetics. If the
parents of each generation have an  IQ of just  1  point above the mean,
then  average  IQ  increases  by  0 .8 %  per  generation.  If  the  average
human  generation  time  in  the  Middle Ages was  2 5  years,  then  in  20
human  generations,  or  5 0 0  years,  Ashkenazi  IQ  would  increase  by
2 0  x  0.8  =  16  IQ  points.

 

More conceptual confusion. One cannot use % on IQs becus IQs are not ratio scale and hence division makes no sense. en.wikipedia.org/wiki/Levels_of_measurement#Comparison

Admixture study for neanderthal ancestry and psychological traits

We have a neanderthal genome.

It is possible to estimate an individuals neanderthal ancestry. 23andme does this.

It is possible to use the admixture study design to see what the effects of some kind of ancestry origin is.

What are we waiting for? They can use the SNP datasets they have used GWA studies for psychological traits.

Girlfriend [12th may 2014]: I bet theres an autism/neanderthal link

Any takers?