Questions tagged [psych]

An R package for analysing personality, psychometrics and experimental psychology. Do not use this tag for Ruby standard library Psych.

psych is an package containing functions for analysing personality, psychometrics and experimental psychology. Functions are primarily for scale construction using factor analysis, and analysis, although others provide basic descriptive statistics. Item Response Theory is done using factor analysis of tetrachoric and polychoric s. Functions for simulating particular item and test structures are included. Several functions serve as a useful front end for structural equation modeling. Graphical displays of path diagrams, and structural equation models are created using basic graphics.

Repositories

Vignettes

Other resources

Related tags

294 questions
6
votes
1 answer

dyld: Symbol not found: _rb_ary_new_from_values When trying to run foreman start

I am receiving the following error when trying to run "foreman start" to execute my rails file. dyld: Symbol not found: _rb_ary_new_from_values Referenced from: /Users/paulbattisson/.rvm/gems/ruby-2.1.1/gems/psych-2.0.5/lib/psych.bundle …
pbattisson
  • 1,230
  • 2
  • 10
  • 24
6
votes
1 answer

Ruby - LoadError enc/trans/single_byte

I encountered a weird problem while using ActiveRecord::Store module in my Ruby on Rails app. As I understand, this module use 'serialize' method under the hood so it just serialize your data to yaml format with ruby built-in psych gem. It works OK…
rgt600
  • 63
  • 5
6
votes
2 answers

in rails warning: already initialized constant

/usr/share/ruby-rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/psych.so: warning: already initialized constant ANY /usr/share/ruby-rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/psych.so: warning: already initialized constant…
Abhiram
  • 1,459
  • 14
  • 23
6
votes
4 answers

Installing libyaml for ruby on a mac osX (Lion)

I am getting this error message: "It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby." I have tried entering this command: rvm pkg install libyaml and I am…
Luke Bessey
  • 63
  • 1
  • 1
  • 3
5
votes
2 answers

How to emit YAML in Ruby expanding aliases

I am looking for a way to emit YAML files avoiding the use of aliases (mostly for simplified human readability). I think extending Psych::Visitors::Emitter or Psych::Visitors::Visitor is the way to go, but I cannot actually find where Ruby decides…
Frigo
  • 362
  • 2
  • 17
5
votes
2 answers

Rails object.to_yaml without leading dashes

Every to_yaml output have three leading dashes: --- a: b: c: soemthing How convert object to yaml without leading dashes?
rootatdarkstar
  • 1,486
  • 2
  • 15
  • 26
5
votes
3 answers

Read and write YAML files without destroying anchors and aliases

This question has been asked before: Read and write YAML files without destroying anchors and aliases? I was wondering how to solve that problem with many anchors and aliases? thanks
Max
  • 1,526
  • 2
  • 16
  • 19
4
votes
2 answers

Why the difference in behavior of YAML parsers (syck and psych)?

Look at this case: ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux] irb(main):006:0> YAML::ENGINE.yamler = "psych" => "psych" irb(main):007:0> '8902-20-13'.to_yaml ArgumentError: invalid date from /usr/local/lib/ruby/1.9.1/date.rb:1022:in…
4
votes
2 answers

How do I deserialize classes in Psych?

How do I deserialize in Psych to return an existing object, such as a class object? To do serialization of a class, I can do require "psych" class Class yaml_tag 'class' def encode_with coder coder.represent_scalar 'class', name …
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
4
votes
2 answers

Getting data frame from loadings of factor analysis (fa function in psych)

I have a data frame such as follows: x <- c(1, 2, 1, 2) y <- c(1, 2, 3, 4) z <- c(4, 3, 2, 1) df <- data.frame(x, y, z) I am running a factor analysis with the fa funciton from the psych package: fit <- fa(df, nfactors = 2) fit$loadings This…
Marco Pastor Mayo
  • 803
  • 11
  • 25
4
votes
1 answer

Change factor labels in psych::fa or psych::fa.diagram

I'm using the psych package for factor analysis. I want to specify the labels of the latent factors, either in the fa() object, or when graphing with fa.diagram(). For example, with toy data: require(psych) n <- 100 choices <- 1:5 df <-…
andrew_reece
  • 20,390
  • 3
  • 33
  • 58
4
votes
1 answer

Running Omega with Psych library in R

I have five items on a construct when i run alpha on it on i get the following results without any errors psych::alpha(construct, na.rm = TRUE, title = 'myscale', n.iter = 1000) Reliability analysis myscale Call:…
John Smith
  • 2,448
  • 7
  • 54
  • 78
4
votes
1 answer

Constructing scores from principal loadings in R

I want to understand how the principal() function in psych package calculate the $score element. I want to try the covariance matrix rather than correlation matrix. model <- principal(mtcars[8:11],nfactors=4, rotate='none', scores=T,…
Novus
  • 135
  • 2
  • 8
4
votes
4 answers

gem install psych error

I'm trying to bundle install a rails project but I'm stuck... when I try to run gem install psych all I get is this: Building native extensions. This could take a while... ERROR: Error installing psych: ERROR: Failed to build gem native…
gibatronic
  • 1,661
  • 2
  • 17
  • 22
4
votes
2 answers

Search/check values in YAML document with Ruby

my goal: check if yaml document include value for specific key using ypath/xpath select value for specified key using ypath/xpath document yaml: app: name: xxx version: xxx description: author: name: xxx surname: xxx …
xyz
  • 2,277
  • 2
  • 25
  • 41
1
2
3
19 20