npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

event-study

v2.7.2

Published

event study npm package

Downloads

46

Readme

Event Study

A NPM package for conducting event studies.

Installation

Run npm install event-study --save.

Features

  • Market Model
    • normalReturn
    • abnormalReturn
    • statisticalTest
    • significantTest
    • CARS
    • newsType (Good, Bad, neutral)
    • unmatchedTradingDayStrategy
  • Constant Mean Model
    • normalReturn
    • abnormalReturn
    • statisticalTest
    • significantTest
    • CARS
    • newsType (Good, Bad, neutral)
    • unmatchedTradingDayStrategy

Terminology

calendar: array of event dates.
stock: stock prices.
market: market prices.
timeline: event study time line that includes: Estimation period (T0T1), Pre-announcement window (T1E), Post-announcement window (ET2), Post-event period (T2T3).
dateColumn: which field in stock or market prices has date format.
operationColumn: which field in stock or market price you want to perform arithmetic operations (default is Close).
unmatchedTradingDayStrategy: if the event date does not exist we can select next trading day or previous trading day. available options are ( NEXT_TRADING_DAY , PREV_TRADING_DAY, SKIP). skip is the default.

How to use

Market Model

Option one: provide information for each date separately.
import { MarketModel } from 'event-study'

const data = {
    calendar: [{
            date: '2016-12-01',
            stock: [{ Date: '2016-12-01', Close: 200 }],
            market: [{ Date: '2016-12-01', Close: 10 }],
            timeline: {
                T0T1: 2,
                T1E: 2,
                ET2: 2,
                T2T3: 2
            },
            dateColumn: 'Date',
            operationColumn: 'Close',
            unmatchedTradingDayStrategy: 'NEXT_TRADING_DAY'
    }]
}

marketModel(data)
Option two: provide information globally.

In this method, every date will use same global information.

import { MarketModel } from 'event-study'

const data = {
    calendar: [
        { date: '2016-12-01' }
    ],
    stock: [{ Date: '2016-12-01', Close: 200 }],
    market: [{ Date: '2016-12-01', Close: 10 }],
    timeline: {
        T0T1: 2,
        T1E: 2,
        ET2: 2,
        T2T3: 2
    },
    dateColumn: 'Date',
    operationColumn: 'Close',
    unmatchedTradingDayStrategy: 'PREV_TRADING_DAY'
}

marketModel(data)
Option three: combine information.

In this method for date '2016-12-01' the global information(stock) will be ignored.

import { MarketModel } from 'event-study'

const data = {
    calendar: [
        { date: '2016-12-01', stock: [{ Date: '2016-12-01', Close: 30 }] }
    ],
    stock: [{ Date: '2016-12-01', Close: 200 }],
    market: [{ Date: '2016-12-01', Close: 10 }],
    timeline: {
        T0T1: 2,
        T1E: 2,
        ET2: 2,
        T2T3: 2
    },
    dateColumn: 'Date',
    operationColumn: 'Close',
    unmatchedTradingDayStrategy: 'SKIP'
}

marketModel(data)

Constant Mean Model

import { MeanModel } from 'event-study'

const data = {
    calendar: [
        { date: '2016-12-01', stock: [{ Date: '2016-12-01', Close: 30 }] }
    ],
    timeline: {
        T0T1: 2,
        T1E: 2,
        ET2: 2,
        T2T3: 2
    },
    dateColumn: 'Date',
    operationColumn: 'Close'
}

marketModel(data)

Analyse results

Results will be in below format:

Result contains information just for EVENT PERIOD (T1E + ET2), for example in above scenario the abnormal return will be an array with 4 item because T1E is 2 and ET2 is 2.

[{
    date, // event date
    normalReturn,
    abnormalReturn,
    statisticalTest, 
    significantTest,
    CARS,
    newsType // 1 means good news, -1 bad news, 0 neutral
}]

Contributing

If you saw any issue or have any recommendation you have 2 option to follow and I will be grateful:

Option one: Fill an issue in github account.
Option two: Send an Email to: [email protected]

Tests

run yarn test