Coder Social home page Coder Social logo

meyerjp3 / psychometrics Goto Github PK

View Code? Open in Web Editor NEW
94.0 16.0 46.0 11.03 MB

A Java library for classical test theory, item response theory, factor analysis, and other measurement techniques. It provide tools commonly used in psychometrics and operational testing programs.

Java 100.00%
psychometrics irt factor-analysis java-library rasch dif scaling-methods java test-theory item-response-theory

psychometrics's Introduction

psychometrics

A Java library for psychometric analysis. View the psychometrics API to learn more about the library. It includes mathematical and statistical procedures that are not part of the Apache commons math library. It is a key component of jMetrik an open source application for psychometrics. See http://www.ItemAnalysis.com for more information about jMetrik and the psychometrics library. The library is licensed under the Apache License, Version 2.0.

Recommended Citation:

Meyer, J. P. (2015). Psychometrics: An open source JavaTM library for measurement [computer software]. Available from https://github.com/meyerjp3/psychometrics.

The psychometrics library was refactored into seven modules. These are:

  • psychometrics-core the base module required by all other module. It contains basic classes for data, exceptoins, and statistics
  • psychometrics-ctt contains classes for classical test theory including item analysis, test scaling, DIF, and reliability estimation.
  • psychometrics-factor has classes for exploratory factor analysis, and for computing polychoric correlations. This module is still in development.
  • psychometrics-fmm contains a few classes for multivariate normal mixture models (i.e. finite mixture models).
  • psychometrics-irt includes classes for item response theory. Joint maximum likelihood for the Rasch family of models is supported. Marginal maximum likelihood estimation for the 2PL, 3PL, 4PL, and GPCM is also supported. Classes for scale linking (e.g. Stocking-Lord) and score equating are in this module.
  • psychometrics-nirt has classes for nonparametric item resposne theory. Specifically, it support Ramsay's kernel regression approach for estimating ICCs.
  • psychometrics-optim is a module for optimization, and it includes the UNCMIN method, a BOBYQAO optimizer, and a Quasi-Newton optimizer.

Item Response Theory (IRT)

This library provides classes for IRT parameter estimation, scale linking, and score equating. Estimation currently involves joint maximum likelihood for the Rasch, partial credit, and rating scale models. Marginal maximum likelihood estimation procedures for binary item response models (Rasch, 2PL, 3PL, 4PL) and polytomous item response models (GPCM, PCM) are also available. Scale linking and score equating classes support a variety of item response models. Scale linking procedures available in the library include the Stocking-Lord and Haebara procedures.

Factor Analysis

Classes for exploratory factor analysis are in development. They currently include MINRES factor analysis and principal components analysis. Some rotations have been implemented.

Classical Test Theory

The library includes classes for classical test scaling methods, reliability estimation, item analysis, and differential item functioning (DIF). Examples of scaling methods include normalized scores and Kelley's regressed score. Reliability methods include Coefficient alpha Guttman's lambda, and other methods. There are classes to support the conditional standard error of measurement and decision consistency indices. Classes that support DIF include the Cochran-Mantel-Haenszel procedure and ETS DIF classification levels.

psychometrics's People

Contributors

meyerjp3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psychometrics's Issues

build appears broken with missing file error

Hi. Thanks for a nice project.

building from master as of today.

Running simulation...
java.io.FileNotFoundException: S:\2014-3pl-simulation\simdata\condition6\cond6_1.csv (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:131)
at java.io.FileReader.(FileReader.java:72)
at com.itemanalysis.psychometrics.irt.estimation.ItemResponseFileSummary.getResponseVectors(ItemResponseFileSummary.java:89)
at com.itemanalysis.psychometrics.irt.estimation.MarginalMaximumLikelihoodEstimationTest.simulationRun(MarginalMaximumLikelihoodEstimationTest.java:1396)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

License and Maven Central

Is there license for this project? If not, is it OK if I include some code from it in a project I'm working on? I would prefer just to grab it from Maven Central, but I can't find it there. Is there a plan to upload it there so it can be included in projects? My workaround is to import all fo the code into my project, which I can do and properly credit and all, but just using the Maven dependency would be the best. Unfortunately, I can't figure out a way to just import the jar into my project, not for lack of trying.

How to estimate parameters of IRT

Hello Meyer, i'm trying to estimate parameters of a IRT model using your library, and I use the following code:

    ItemResponseModel[] itens = new ItemResponseModel[18];
    for (int i = 0; i < itens.length; i++) {
        itens[i] = new Irm3PL(0.0, 1.0);
        itens[i].setName(new VariableName("V" + (i + 1)));
    }

    byte[][] respostas = {
        {1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0},
        {1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0}
    };


    JointMaximumLikelihoodEstimation estimation = new JointMaximumLikelihoodEstimation(respostas, itens);

    estimation.estimateParameters(150, 0.0001);
    estimation.summarizeData(0.3);
    estimation.computeItemStandardErrors();
    estimation.computePersonStandardErrors();

    System.out.println(estimation.printIterationHistory());
    System.out.println(estimation.printItemStats("Status"));

The output of this code:

Iteration Delta Log-likelihood

     1                   NaN                      NaN

                                       Status                                                             

Item Difficulty Std. Error WMS Std. WMS UMS Std. UMS

v1 NaN NaN NaN NaN NaN NaN Minimum
v2 NaN NaN NaN NaN NaN NaN Minimum
v3 NaN NaN NaN NaN NaN NaN Minimum
v4 NaN NaN NaN NaN NaN NaN
v5 NaN NaN NaN NaN NaN NaN
v6 NaN NaN NaN NaN NaN NaN
v7 NaN NaN NaN NaN NaN NaN
v8 NaN NaN NaN NaN NaN NaN
v9 NaN NaN NaN NaN NaN NaN
v10 NaN NaN NaN NaN NaN NaN
v11 NaN NaN NaN NaN NaN NaN
v12 NaN NaN NaN NaN NaN NaN
v13 NaN NaN NaN NaN NaN NaN
v14 NaN NaN NaN NaN NaN NaN
v15 NaN NaN NaN NaN NaN NaN
v16 NaN NaN NaN NaN NaN NaN
v17 NaN NaN NaN NaN NaN NaN

v18 NaN NaN NaN NaN NaN NaN Maximum

What I'm doing wrong?

Tranks for the great library.

Feature Requests - Many Facet Models

Hi,

I was wondering if you've considered adding capabilities to fit many Facet Rasch models to the library? I'm not sure how much effort it would require, but I think it would be a pretty awesome contribution since there doesn't seem to be too many options to fit these types of models without purchasing Facets or rolling your own solution. It'd also be extraordinarily useful in K-12 education to evaluate rater parameters for observational protocols.

mvn install failed

Seems like there is missing javafx dependency:

[INFO] Reactor Summary for Psychometrics 2.0:
[INFO]
[INFO] Psychometrics ...................................... SUCCESS [ 0.611 s]
[INFO] psychometrics-core ................................. SUCCESS [ 10.613 s]
[INFO] psychometrics-ctt .................................. FAILURE [ 2.656 s]
[INFO] psychometrics-optim ................................ SKIPPED
[INFO] psychometrics-factor ............................... SKIPPED
[INFO] psychometrics-fmm .................................. SKIPPED
[INFO] psychometrics-irt .................................. SKIPPED
[INFO] psychometrics-nirt ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.124 s
[INFO] Finished at: 2019-04-26T18:25:02+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:testCompile (default-testCompile) on project psychometrics-ctt: Compilation failure: Compilation failure:
[ERROR] /home/user/joel/rnd/test/psychometrics/psychometrics-ctt/src/test/java/com/itemanalysis/psychometrics/classicalitemanalysis/StreamingItemAnalysisTest.java:[3,25] error: package javafx.application does not exist
[ERROR]
[ERROR] /home/user/joel/rnd/test/psychometrics/psychometrics-ctt/src/test/java/com/itemanalysis/psychometrics/classicalitemanalysis/StreamingItemAnalysisTest.java:[4,28] error: package javafx.beans.property does not exist
[ERROR]
[ERROR] /home/user/joel/rnd/test/psychometrics/psychometrics-ctt/src/test/java/com/itemanalysis/psychometrics/classicalitemanalysis/StreamingItemAnalysisTest.java:[5,28] error: package javafx.beans.property does not exist
[ERROR]
[ERROR] /home/user/joel/rnd/test/psychometrics/psychometrics-ctt/src/test/java/com/itemanalysis/psychometrics/classicalitemanalysis/StreamingItemAnalysisTest.java:[6,25] error: package javafx.collections does not exist
[ERROR]
[ERROR] /home/user/joel/rnd/test/psychometrics/psychometrics-ctt/src/test/java/com/itemanalysis/psychometrics/classicalitemanalysis/StreamingItemAnalysisTest.java:[7,25] error: package javafx.collections does not exist

ArrayIndexOutOfBoundsException in AbstractPolychoricCorrelation

When this piece of code is run, invalid offsets are accessed within the x2 array:

    //Eliminate rows and columns with nonzero sums
    if(validRowcount!=nrow || validColCount!=ncol){
        double[][] x2 = new double[validRowcount][validColCount];
        int r=0;
        int c=0;
        N=0;
        for(int i=0;i<nrow;i++){
            c=0;
            for(int j=0;j<ncol;j++){
                x2[r][c] = data[goodRow[i]][goodCol[j]];
                N+=x2[r][c];
                c++;
            }
            r++;
        }
        data=x2;
        nrow = data.length;
        ncol = data[0].length;
    }

As I'm not quite sure what is supposed to happen at this point, I didn't submit a pull request.

License

Hi,

is there any license available for this project? It would be great if this projected would be licensed under BSD, Apache Common License, LGPL or MIT.

Thank you for your work ๐Ÿ‘

Christian

Factor Analysis on Polychoric Correlation Matrix?

Hello,
I came across your library searching for factor analysis software in Java.
I am trying to see if it is possible to conduct factor analysis over categorical variables using this library, as suggested here in the first answer: http://stats.stackexchange.com/questions/32234/reference-on-factor-analysis-with-categorical-variables

But as I am not well versed in this subject I am not sure: Is it possible? If so, could you provide a small hint on how to try it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.