Package 'discFA'

Title: Discrete Factor Analysis
Description: Discrete factor analysis for dependent Poisson and negative binomial models with truncation, zero inflation, and zero inflated truncation.
Authors: Yasin Asar [aut] , Reza A. Belaghi [aut, cre] , Rolf Larsson [aut]
Maintainer: Reza A. Belaghi <[email protected]>
License: GPL-3
Version: 1.0.1
Built: 2024-11-02 03:11:15 UTC
Source: https://github.com/cran/discFA

Help Index


Car data

Description

This dataset contains 90 responses for 14 different variables that customers consider while purchasing car. The survey questions were framed using 5 point likert scale with 1 being very low and 5 being very high. The data can be downloaded from the given link. The variables are the following: 1. Price 2. Safety 3. Exterior looks 4. Space and comfort 5. Technology 6. After sales service 7. Resale value 8. Fuel type 9. Fuel efficiency 10. Color 11. Maintenance 12. Test drive 13. Product reviews 14. Testimonials

Usage

car_data

Format

Car data

Source

https://rpubs.com/harshaash/EFA


Discrete factor analysis for the negative binomial distribution

Description

Discrete factor analysis for the negative binomial distribution

Usage

dfnb(y)

Arguments

y

Data, an n by d numeric matrix

Value

A list with entries

AIC

AIC value for the optimal model

indexmat

Factors and variables in each factor

estr0

Estimated value of r for the negative binomial distributed factor(s)

estp0

Estimated value of p for the negative binomial distributed factor(s)

estr

Estimated value of r for the negative binomial distributed observations(s)

estp

Estimated value of r for the negative binomial distributed observations(s)

Examples

dfnb(zinb100_Data[1:40,1:5])

Discrete factor analysis for the truncated negative binomial distribution (with right truncation at A)

Description

Discrete factor analysis for the truncated negative binomial distribution (with right truncation at A)

Usage

dfnbt(y, A)

Arguments

y

Data, an n by d numeric matrix

A

truncation point (Note that if the data is in Likert scale starting from 1, then you should subtract 1 from the data and then use the proposed negative binomial models.

Value

A list with entries

AIC

AIC value for the optimal model

indexmat

Factors and variables in each factor

estr0

Estimated value of r for the factor

estp0

Estimated value of p for the factor

estr

Estimated value of r for the observation

estp

Estimated value of r for the observation

Examples

dfnbt(zinb100_Data[1:40,1:3], A = 6)

Discrete factor analysis with the Poisson distribution

Description

Discrete factor analysis with the Poisson distribution

Usage

dfp(y)

Arguments

y

Data, an n by d numeric matrix

Value

A list with entries

AIC

AIC value for the optimal model

indexmat

Factors and variables in each factor

estlambda

Estimated parameters for factors

estmu

Estimated parameters for each variable within each factor

Examples

dfp(car_data[,2:9])

Discrete factor analysis with the truncated Poisson distribution

Description

Discrete factor analysis with the truncated Poisson distribution

Usage

dfpt(y, A = NULL)

Arguments

y

Data, an n by d numeric matrix

A

truncation point (Note that if the data is in Likert scale starting from 1, then you should subtract 1 from the data and then use the proposed negative binomial models.

Value

A list with entries

AIC

AIC value for the optimal model

indexmat

Factors and variables in each factor

estlambda

Estimated parameters for factors

estmu

Estimated parameters for each variable within each factor

Examples

dfpt(y = car_data[,1:5], A = 5)

Discrete factor analysis with the zero inflated negative binomial distribution.

Description

Discrete factor analysis with the zero inflated negative binomial distribution.

Usage

dfzinb(y, tol = 1e-06)

Arguments

y

Data, an n by d numeric matrix

tol

tolerance value for optimizations

Value

A list with entries

AIC

AIC value for the optimal model

indexmat

Factors and variables in each factor

estpi0

Estimated value of p for the zero inflated part in the negative binomial distributed factor

estr0

Estimated value of r the negative binomial distributed factor(s)

estp0

Estimated value of p the negative binomial distributed factor(s)

estpi

Estimated parameters for the zero inflated part in the negative binomial distributed observations(s)

estr

Estimated value of r negative binomial distributed observations(s)

estp

Estimated value of p negative binomial distributed observations(s)

Examples

dfzinb(zinb100_Data[1:40,1:3])

Discrete factor analysis with the zero inflated truncated negative binomial distribution.

Description

Discrete factor analysis with the zero inflated truncated negative binomial distribution.

Usage

dfzinbt(y, A, tol = 1e-06)

Arguments

y

Data, an n by d numeric matrix

A

truncation point (Note that if the data is in Likert scale starting from 1, then you should subtract 1 from the data and then use the proposed negative binomial models.

tol

tolerance value for optimizations

Value

A list with entries.

AIC

AIC value for the optimal model

indexmat

Factors and variables in each factor

estpi0

Estimated value of p for the zero inflated part in the negative binomial distributed factor

estr0

Estimated value of r the negative binomial distributed factor(s)

estp0

Estimated value of p the negative binomial distributed factor(s)

estpi

Estimated parameters for the zero inflated part in the negative binomial distributed observations(s)

estr

Estimated value of r negative binomial distributed observations(s)

estp

Estimated value of p negative binomial distributed observations(s)

Examples

dfzinbt(zinb100_Data[1:20,1:3], A = 6)

Discrete factor analysis with the zero inflated Poisson distribution

Description

Discrete factor analysis with the zero inflated Poisson distribution

Usage

dfzip(y)

Arguments

y

Data, an n by d numeric matrix

Value

A list with entries

AIC

AIC value for the optimal model

indexmat

Factors and variables in each factor

estpilam

Estimated zero-inflated parameters for for each factor

estlam

Estimated parameters for each factor

estpimu

Estimated zero-inflated parameters for each variable within each factor

estmu

Estimated parameters for each variable within each factor

Examples

dfzip(car_data[,1:3])

Discrete factor analysis with the truncated zero inflated Poisson distribution

Description

Discrete factor analysis with the truncated zero inflated Poisson distribution

Usage

dfzipt(y, A = NULL)

Arguments

y

Data, an n by d numeric matrix

A

truncation point (Note that if the data is in Likert scale starting from 1, then you should subtract 1 from the data and then use the proposed negative binomial models.

Value

A list with entries

AIC

AIC value for the optimal model

indexmat

Factors and variables in each factor

estpilam

Estimated zero-inflated parameters for for each factor

estlam

Estimated parameters for each factor

estpimu

Estimated zero-inflated parameters for each variable within each factor

estmu

Estimated parameters for each variable within each factor

Examples

dfzipt(zinb100_Data[1:50,1:3], A = 6)

Original potato data

Description

This dataset contains 1152 observation with four variables that are either ordinal or counts. These variables are as follows: x1: Energy factor in the ordinal scale of 1 to 2 x2: weight in the ordinal scale of 1 to 3 x3: damage category in the ordinal scale of 1 to 4 x4: the count of tubers in each combination of categories as an integer value.

Usage

original_potato_data

Format

Original potato data

Source

https://cran.r-project.org/web/packages/agridat/index.html


Potato data

Description

TThis dataset contains 1152 observation with four variables (y1 to y4). We generated this data set from the original_potat_data by the following instruction to use for the discrete factor analysis:

y1=x1min(x1)y1 = x1 - min(x1)

y2=max(x2)x2y2 = max(x2) - x2

y3=max(x3)x3y3 = max(x3) - x3

y4=x4.y4 = x4.

Usage

potato_data

Format

Potato data


SCS data

Description

The Sexual Compulsivity Scale (SCS) was developed to assess tendencies toward sexual preoccupation and hypersexuality. Items were initially derived from self-descriptions of persons who self-identify as having a ‘sexual addiction’. The self-descriptors were taken from a brochure for a sexual addictions self-help group. The scale should predict rates of sexual behaviors, numbers of sexual partners, practice of a variety of sexual behaviors, and histories of sexually transmitted diseases. The data set were available at http://openpsychometrics.org/_rawdata/ and updated at 7/16/2012. The data set has 3376 observations with 13 variables of which 10 variables (Q1 to Q10) were the questions about the description of the sexual behaviour.

Usage

SCS_data

Format

SCS data

Source

http://openpsychometrics.org/_rawdata/


Survey data

Description

The questionnaire is five Likert scale data (strongly disagree (1) to strongly agree (5)). For some negative questions, the scale was reversed. We choose 13 variables (sample size = 435). Optimism Scale: opt1 to opt6. Mastery Scale: mast1 to mast7 to identity the hidden factors.

Usage

survey_data

Format

Survey data

Source

http://openpsychometrics.org/_rawdata/


zinb100 Simulated Data

Description

100 Simulated samples from a zero-inflated truncated (truncation at 6) negative binomial process with (1,3,4,2) factor structure.

Usage

zinb100_Data

Format

zinb100_Data