-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrhom example.py
41 lines (33 loc) · 1.7 KB
/
rhom example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import pandas as pd
from ThoughtSpace.rhom import splithalf, omni_sample, dir_proj, bypc
df = pd.read_csv('output.csv')
# If not specifying a grouping variable, remember to specify only the data to be decomposed
splithalf_df = df.iloc[:, 2:11]
split_results = splithalf(df = splithalf_df,
npc = 4,
rotation = "promax",
boot = 1000,
file_prefix = "example_splithalf",
save = False)
# When conducting a direct-projection reproducibility analysis remember to specify the grouping variable whose levels you're comparing
dirproj_df = df.iloc[:,2:11]
dirproj_df['group'] = df['grouping variable']
dirproj_results = dir_proj(df = dirproj_df,
group = "group",
npc = 4,
rotation = "varimax",
folds = 5,
file_prefix = "example_directproject")
# An omnibus-sample reproducibility analysis can provide an alternative way of determining how robustly disparately sampled data can be blended
omsamp_results = omni_sample(df = dirproj_df,
group = 'group',
npc = 4,
rotation = "varimax",
boot = 1000,
file_prefix = "example_omsamp")
# If split-half reliability is strong enough, you can examine omnibus-sample reproducibility on a by-component level.
bypc_results = bypc(df = df,
group = 'group',
npc = 4,
rotation = "varimax",
file_prefix = "example_byPC")