Skip to content

Instantly share code, notes, and snippets.

. clear all
. set seed 123
.
. * recruit subjects (if only this easy...)
. set obs 2000
number of observations (_N) was 0, now 2,000
import difflib
import requests
import itertools
from bs4 import BeautifulSoup
from envelopes import Envelope, GMailSMTP
indexpage = requests.get("https://www.plymouth.ac.uk/schools/school-of-psychology/academics")
indexsoup = BeautifulSoup(indexpage.text, 'html.parser')
staffpages = (i.get("href") for i in list(indexsoup.find_all("a")) if i.get("href").find("/staff/") > -1)
Perhaps more likely to make a mistake when marked with @
Less likely to fluff places marked $
@ @ $ $
COUNT 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
– – – – – – – X – – – – – – – X – – – – – – – X – – – – – – – X – – – – – – – X
– – – – – – X – – – – – – X – – – – – – X – – – – – – X – – – – – – X – – – – –
COUNT 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5
  • Information [a single page split into]

    • Biography
    • Teaching at Plymouth
    • Other work roles
    • Tai Chi and Shiatsu
    • Directory content
  • Writing [a single page for each of the below... think of this a bit like a blog with a categorised archive]

    • Reviews
  • Articles

t tests - Means: Difference between two independent means (two groups)
Analysis: Post hoc: Compute achieved power
Input: Tail(s) = One
Effect size d = 0.52
α err prob = 0.05
Sample size group 1 = 49
Sample size group 2 = 48
Output: Noncentrality parameter δ = 2.5605669
Critical t = 1.6610518
import os
import speech_recognition as sr
r = sr.Recognizer()
def gettextfromaudio(file):
try:
with sr.WavFile(file) as source:
audio = r.record(source)
"witnesses": "dudes I know",
"allegedly": "kinda probably",
"new study": "Tumblr post",
"rebuild": "avenge",
"space": "spaaace",
"Google Glass": "Virtual Boy",
"smartphone": "Pokédex",
"electric": "atomic",
"senator": "elf-lord",
"car": "cat",
. use for_analysis.dta, replace
. keep if after == 1 & tetris == 1
(1,867 observations deleted)
. count
603
. statsby, by(person) clear: count
. use for_analysis.dta, replace
. // frequency of measurement occasions
. tab cravingcats
Secondary coding | Freq. Percent Cum.
---------------------+-----------------------------------
not craving | 867 70.32 70.32
. preserve
. keep if after == 1 & tetris == 1
(1,863 observations deleted)
. count
603
. statsby, by(person cravingcats tetris) clear: count
(running count on estimation sample)