Movatterモバイル変換


[0]ホーム

URL:


Type:Package
Title:Multivariate Analysis with Optimal Scaling
Version:1.0-0
Date:2025-08-28
Description:Implements various Gifi methods in a user-friendly way: categorical principal component analysis (princals), multiple correspondence analysis (homals), monotone regression analysis (morals).
URL:https://r-forge.r-project.org/projects/psychor/
Imports:graphics, stats, colorspace
Depends:R (≥ 4.0.0)
License:GPL-3
Suggests:knitr, psych, psychTools, MPsychoR, MASS, ggplot2, rmarkdown
VignetteBuilder:knitr
LazyData:yes
LazyLoad:yes
ByteCompile:yes
NeedsCompilation:yes
Packaged:2025-08-28 15:33:52 UTC; patrick
Author:Patrick Mair [aut, cre], Jan De Leeuw [aut], Patrick J. F. Groenen [ctb]
Maintainer:Patrick Mair <mair@fas.harvard.edu>
Repository:CRAN
Date/Publication:2025-08-28 22:40:17 UTC

ABC Customer Satisfaction

Description

The ABC Company (a fictitious company) is a typical global supplier of integrated software, hardware, and servicessolutions to media and telecommunications service providers. The company develops, installs andmaintains systems combining hardware, software and advanced electronics. These enabling systemssupport various lines of business, including Video on Demand, cable, and satellite TV, as well as arange of communications services, such as voice, video, data, Internet protocol, broadband, content,electronic, and mobile commerce. They launched an customer satisfaction surveydesigned to provide feedback on all company touch points andinteractions with customers. It covers topics such as Equipment, Sales Support, Technical Support,Training, Supplies, Software Solutions, Customer Portal, Administrative Support, Terms, Conditionsand Pricing and Site Planning and Installation.

Usage

ABC

Format

Data frame with 11 items on a 5-point Likert scale (except one item, see below)

satis:

Overall satisfaction level from ABC. (1 ... very low, 5 ... very high)

satis2010:

Overall satisfaction level from ABC's improvements during 2010. (1 ... very low, 5 ... very high)

best:

Is ABC your best supplier? (0 ... no; 1 ... yes)

recom:

Would you recommend ABC to other companies? (1 ... very unlikely, 5 ... very likely)

product:

If you were in the market to buy a product, how likely would it be for you to purchase an ABC product again? (1 ... very unlikely, 5 ... very likely)

equipment:

Overall satisfaction level from the equipment. (1 ... very low, 5 ... very high)

sales:

Overall satisfaction level from sales support. (1 ... very low, 5 ... very high)

technical:

Overall satisfaction level from technical support. (1 ... very low, 5 ... very high)

training:

Overall satisfaction level from ABC training. (1 ... very low, 5 ... very high)

purchase:

Overall satisfaction level from purchasing support. (1 ... very low, 5 ... very high)

pricing:

Overall satisfaction level from pricing and contracts. (1 ... very low, 5 ... very high)

References

Kenett, R. S., & Salini, S. (2012). Modern Analysis of Customer Surveys with Applications in R. New York: Wiley.

Examples

   head(ABC)

Wilson-Patterson Conservatism Scale

Description

This dataset contains a modified version of the classical Wilson-Patterson conservatism scale. Here we use a subset of the data included in theMPsychoR package.

Usage

data("WilPat2")

Format

The first 15 items are conservative items, the remaining ones are liberal. Each item has the following response categories: 0 ... disapprove, 1 ... approve, 2 ... don't know. There are 493 persons in the sample. In addition there are the following covariates:

Country

Participant's country.

LibCons

Self-reported liberalism/conservatism.

LeftRight

Self-reported left/right identification.

Gender

Gender.

Age

Age.

Note

Thanks to Benedek Kurdi and Levente Littvay for providing this dataset.

Examples

data("WilPat2")str(WilPat2)

Cross-validation for Morals fit

Description

Performs a k-fold CV on Morals objects and returns the CV error.

Usage

cv(object, folds = 10, verbose = FALSE, ...)

Arguments

object

Object of class"morals"

folds

Number of folds for cross-validation (for LOOCV set it equal to n).

verbose

IfTRUE, iteration is printed out

...

Additional arguments (ignored here)

Examples

## mimic linear regressionxknots <- knotsGifi(neumann[,1:2], "E")  yknots <- knotsGifi(neumann[,3], "E")fitlin <-  morals(neumann[,1:2], neumann[,3], xknots = xknots, yknots = yknots,                   xdegrees = 1, ydegrees = 1, xordinal = FALSE, yordinal = FALSE)cv(fitlin)  ## CV error of prediction

GALO dataset

Description

The objects (individuals) are 1290 school children in the sixth grade of elementaryschool in the city of Groningen (Netherlands) in 1959.

Usage

galo

Format

Data frame with the five variables Gender, IQ, Advice, SES and School. IQ (original range 60 to 144) has been categorized into 9 ordered categories and the schools are enumerated from 1 to 37.

SES:

LoWC = Lower white collar; MidWC = Middle white collar; Prof = Professional, Managers;Shop = Shopkeepers; Skil = Schooled labor; Unsk = Unskilled labor.

Advice:

Agr = Agricultural; Ext = Extended primary education; Gen = General; Grls = Secondary school for girls; Man = Manual, including housekeeping; None = No further education; Uni = Pre-University.

References

Peschar, J.L. (1975). School, Milieu, Beroep. Groningen: Tjeek Willink.

Examples

   data(galo)   galo

Guttman-Bell dataset

Description

This dataset deals with attitudes of social groups.

Usage

gubell

Format

The data frame consists of 7 objects and 5 variables with a total of 17 categories.

References

Guttman, L. (1968), A General Nonmetric Technique for Fitting the Smallest Coordinate Space for a Configurationof Points, Psychometrika, 33, 469-506.

Examples

   data(gubell)   gubell

Hartigan's Hardware

Description

A number of bolts, nails, screws, and tacks are classified according to a number of criteria.

Usage

hartigan

Format

A data frame with the following variables and categories:

Thread: Y = Yes, N = No

Head: F = Flat, C = Cup, O = Cone, R = Round, Y = Cylinder

Head indentation: N = None, T = Star, L = Slit

Bottom: S = Sharp, F = Flat

Length: (in half inches)

Brass: Y = Yes, N = No

References

Hartigan, J.A. (1975). Clustering Algorithms. New York: Wiley.

Examples

   data(hartigan)   hartigan

Multiple Correspondence Analysis (HOMALS).

Description

Fits a multiple correspondence analysis (MCA). The default is to take each input variable as nominal. Through restrictions on the transformations (ordinal in conjunction with splines) various generalizations of MCA can be achieved.

Usage

homals(data, ndim = 2, levels = "nominal", ordinal, knots, ties = "s", degrees = -1, missing = "s", normobj.z = TRUE, active = TRUE, itmax = 1000, eps = 1e-6, verbose = FALSE)

Arguments

data

Input data frame: n observations, m variables

ndim

Number of dimensions to be computed

levels

A vector of length m denoting basic scale levels ("nominal","ordinal","metric"; see details

ordinal

If knots are specified manually, a boolean vector of length m denotes which variables should be ordinally restricted or not (see details)

knots

Scale levels can be specified manually using splines (seeknotsGifi). If knots is set, this overrideslevel (see details)

ties

How ties should be handled: primary ("p"), secondary ("s"), or tertiary ("t")

degrees

Spline degrees. If different degrees should be used across variables, a vector of length m can be specified. The default value of -1 indicates nominal scale level (overrides the ordinal argument).

missing

How missing values should be handled: multiple ("m"), single ("s"), or average ("a")

active

Which variables should be active or inactive (also as vector of length m)

normobj.z

IfTRUE, object scores are z-scores, ifFALSE, they are restriction to SS of 1.

itmax

Maximum number of iterations

eps

Convergence criterion

verbose

Iteration printout

Details

The measurement (or scale) levels of the variables are incorporated via spline transformations. If the user only needs simple scale levels like nominal, ordinal, and metric, a corresponding vector can be specified in thelevels argument without settingknots andordinal. The corresponding spline transformations (unrestricted, monotone, and linear) are then created internally. If all scale level transformations are the same,ordinal can be a single value. For more advanced transformations such as polynomial or more flexible splines, theknots andordinal arguments need to be specified instead oflevels.

Value

transform

Optimally transformed scores

rhat

Induced correlation matrix

evals

Eigenvalues of induced correlation matrix

objectscores

Object scores (rows)

scoremat

Optimally scaled data matrix (first dimension)

quantifications

Category quantifications

dmeasures

Discimination matrices

lambda

Average discrimination matrix

weights

Component weights

loadings

Component loadings

ntel

Number of iterations

f

Loss function value

data

Original data frame

datanum

Numerical data frame

ndim

Number of extracted dimensions

call

Function call

References

Gifi, A. (1990). Nonlinear Multivariate Analysis. New York: Wiley.

De Leeuw, J., Mair, P., Groenen, P. J. F. (2017). Multivariate Analysis with Optimal Scaling.

See Also

princals,plot.homals

Examples

## multiple CA fithart <- homals(hartigan)fithartsummary(fithart)

House

Description

The votes selected cover a full spectrum of domestic, foreign, economic,military, environmental and social issues. We tried to select votes whichdisplay sharp liberal/conservative contrasts. In many instances we have chosenprocedural votes: amendments, motions to table, or votes on rules for debate. Oftenthese votes reveal true attitudes frequently obscured in the final votes.

Usage

house

Format

A data frame with the following variables:

Party: R = Republican, D = Democrat, I = Independent.

V1: HR 333. Bankruptcy Overhaul. Jackson-Lee (D-TX) amendment to allowdebtors to deduct additional medical and child-care expenses beforedetermining their eligibility for Chapter 7 bankruptcy status. The amendmentalso expands the definition of family farmer, changes the standardsfor calculating median income, and includes debtor privacy provisions. Rejected160-258. March 1, 2001. A yes vote is a +.

V2: SJ Res 6. Ergonomics Rule Disapproval. Passage of the joint resolutionto reverse the ergonomics workplace safety rule submitted by the ClintonAdministration's Labor Department. Passed 223-206. March 7, 2001. Ano vote is a +.

V3: HR 3. Income Tax Reduction. Passage of the White House's bill to lowerfederal income taxes by restructuring the five existing tax brackets into four- 10 percent, 15 percent, 25 percent and 33 percent. The benefits of this taxcut go disproportionately to the wealthy and to major corporations. Thelarge cost of the legislation would jeopardize domestic spending programsaimed at middle- and low-income Americans. Passed 230-198. March 8,2001. A no vote is a +.

V4: HR 6. Marriage Tax Reduction. Rangel (D-NY) substitute amendmentto reduce taxes by $585.5 billion through 2011. This tax cut would be considerablyless regressive and more equitable than the Republican version.The Rangel plan would create a new 12 percent bracket for the first $20,000of a couple's taxable income and $10,000 for single taxpayers. It alsowould increase the standard deduction for married couples filing jointly totwice that of individuals filing singly. Additionally, the amendment wouldsimplify and expand the earned-income tax credit for low-income earners.Rejected 196-231. March 29, 2001. A yes vote is a +.

V5: HR 8. Estate Tax Relief. Rangel (D-NY) substitute amendment to increasethe estate tax exemption from $675,000 to $2 million ($4 millionfor married couples) in 2002, rising to $2.5 million by 2010. This legislationserves as an alternative to the drastic Republican abolition of theprogressive estate tax. The Rangel tax cut would lower federal revenueby $39.2 billion over ten years. The amendment would retain current-lawstep-up basis provisions, and replace the credit for estate taxes paid to astate with a deduction. Rejected 201-227. April 4, 2001. A yes vote is a +.

V6: HR 503. Fetal Protection. Passage of the bill to make it a criminal offenseto injure or kill a fetus during the commission of a violent federal crime.The measure would establish criminal penalties equal to those that wouldapply if the injury or death occurred to a pregnant woman, regardless of theperpetrator's knowledge of the pregnancy or intent to harm the fetus. Thebill states that its provisions should not be interpreted to apply to consensualabortion or to a woman's actions with respect to her pregnancy. Thedeath penalty could not be imposed under this bill. Passed 252-172. April26, 2001. A no vote is a +.

V7: HR 1. School Vouchers. Armey (R-TX) amendment to provide federalfunding for students to attend private schools, including religious schools,if they are currently enrolled in schools that are dangerous or have beenlow-performing for three years. Crime victims also would be providedwith funding to attend alternative private schools. Rejected 155-273. May23, 2001. A no vote is a +.

V8: HR 1836. Tax Cut Reconciliation Bill. Adoption of the conference reporton the bill to reduce taxes by $1.35 trillion through fiscal 2011 via incometax rate cuts, relief of the marriage penalty, phaseout of the federal estatetax, doubling of the child tax credit, and new incentives for retirementsavings. A new 10 percent tax rate would be created retroactive to January1. The bill would: double the $500-per-child tax credit by 2010 and makeit refundable; raise the estate tax exemption to $1 million in 2002 andrepeal the tax in 2010; increase the standard deduction for married couplesto double that of singles over five years, beginning in 2005; and increaseannual contributions limits for Individual Retirement Accounts. The bill'sprovisions would expire December 31, 2010. Adopted 240-154. May 26,2001. A no vote is a +.

V9: HR 2356. Campaign Finance Reform. Adoption of the rule to allow theHouse to consider a ban on soft money donations to national politicalparties. This rule was crafted by campaign finance reform foes to disallowamendments which fine-tune the bill and, thus, keep reform advocatesfrom gathering more votes in support of final passage. Beyond banningsoft money, the original reform legislation would allow up to $10,000 insoft-money donations to state and local parties for voter registration andget-out-the vote activity. The reform bill would prevent issue ads from targetingspecific candidates within 60 days of a general election or 30 daysof a primary. Additionally, the legislation would maintain the current individualcontribution limit of $1,000 per election for House candidates butraise it to $2,000 for Senate candidates, both of which would be indexedfor inflation. Rejected 203-228. July 12, 2001. A no vote is a +.

V10: HJ Res 36. Flag Desecration. Passage of the joint resolution proposinga Constitutional amendment to prohibit physical desecration of the U. S.flag. Passed 298-125. (A two-thirds majority vote of those present andvoting - 282 in this case - is required to pass a joint resolution proposingan amendment to the Constitution.) July 17, 2001. A no vote is a +.

V11: HR 7. Faith-Based Initiative. Conyers (D-MI) motion to recommit thebill to the Judiciary Committee with instructions to add language statingthat federally-funded religious service providers cannot discriminate basedon religion and that no provision supercedes state or local civil rights laws.Motion rejected 195-234. July 19, 2001. A yes vote is a +.

V12: HJ Res 50. China Normalized Trade Relations. Passage of a joint resolutionto deny the President's request to provide normal trade relations(formerly known as most-favored-nation trade status) for items producedin China from July 2001 through July 2002. Rejected 169-259. July 19,2001. A yes vote is a +.

V13: HR 4. ANWR Drilling Ban. Markey (D-MA) amendment to maintain thecurrent prohibition on oil drilling in the Arctic National Wildlife Refuge.Rejected 206-223. August 1, 2001. A yes vote is a +.

V14: HR 2563. Patients' Rights/HMO Liability. Norwood (R-GA) amendmentto limit liability and damage awards when a patient is harmed bydenial of health care. This amendment was offered after patients' rightsopponents in the White House exerted pressure on Rep. Norwood to abandona stronger bill. The legislation would allow a patient to sue a healthmaintenance organization (HMO) in state court but with federal, not state,law governing. An employer could remove cases to federal court. Thebill would limit non-economic damages to $1.5 million. Punitive damageswould be limited to the same amount and only allowed when a decisionmakerfails to abide by a grant of benefits by an independent medical reviewer.Adopted 218-213. August 2, 1001. A no vote is a +.

V15: HR 2563. Patients' Bill of Rights. Passage of the bill to provide federalhealth care protections, such as access to specialty and emergency roomcare, and require that health maintenance organizations (HMOs) have anappeals process for patients who are denied care. This weakened legislationwas offered to head off consideration of a stronger version. A patientdenied care could sue an HMO in state and federal court but first must exhaustinternal and external appeals processes. Passed 226-203. August 2,2001. A no vote is a +.

V16: HR 2944. Domestic Partner Benefits. Weldon (R-FL) amendment tothe FY 2002 District of Columbia Appropriations Bill that would prohibitthe use of local, as well as federal, funds to extend city employees' healthbenefits to unmarried domestic partners. Rejected 194-226. September 25,2001. A no vote is a +.

V17: HR 2586. U.S. Military Personnel Overseas/Abortions. Sanchez (DCA)amendment to the FY 2002 Defense Authorization Bill which allowsfemale military personnel stationed at U.S. bases overseas to undergo anabortion at medical facilities there provided they pay for it themselves anda doctor consents to perform the operation. Rejected 199-217. September25, 2001. A yes vote is a +.

V18: HR 2975. Anti-Terrorism Authority. Adoption of the rule to providefor House consideration of the bill that would expand law enforcement'spower to investigate suspected terrorists and beef up domestic surveillance.The legislation threatens the civil liberties, civil rights, and due processprotections guaranteed individuals in the United States. Adopted 214-208.October 12, 2001. A no vote is a +.

V19: HR 3090. Economic Stimulus. Passage of the Republican version of thepost- September 11 economic stimulus package. The bill would grant businessesand individuals $99.5 billion in federal tax cuts in fiscal 2002, anda total of $159.4 billion in reductions over 10 years. Additionally, the billwould allow more individuals to receive tax rebates for 2000, acceleratea reduction of the 27 percent tax bracket to 25 percent, lower the capitalgains tax rate from 20 percent to 18 percent and eliminate the corporatealternative minimum tax. Also, the legislation would provide $3 billion tostates for health insurance for the unemployed. Passed 216-214. October24, 2001. A no vote is a +.

V20: HR 3000. Trade Promotion Authority/Fast Track. Passage of the bill toallow expedited negotiation and implementation of trade agreements betweenthe executive branch and foreign countries. The bill includes provisionsrequiring increased consultations with Congress on any proposedchanges of tariffs for imports of sensitive agriculture products and on tradedisparities for textile products. Passed 215-214. December 6, 2001. A nois a +.

References

Ada (2002). 2001 Voting Record: Shattered Promise of Liberal Progress. ADA Today, 57(1), 1-17.

Examples

   data(house)   house

Utility function for Gifi knot specifications.

Description

Produces a list of knots used as input argument in various Gifi functions (homals,princals,morals, etc.). Contains options for placing knots at the quantiles, for knots equally spaced on the range, for knots at the data points, and for no interior knots.

Usage

knotsGifi(x, type = c("Q", "R", "E", "D"), n = 3)

Arguments

x

Data frame

type

"Q" for knots at the quantiles,"R" for equally spaced knots,"E" for no interior knots,"D" for knots at the data points

n

Number of interior knots (ignored fortype = "E" andtype = "D")

Details

Simple linear or polynomial transformations can be specified usingtype = "E" and the corresponding degree in the subsequent Gifi function call. If the data frame contains factors, they are converted internally to numeric usingmakeNumeric.

Value

A list containing knots for each variable.

Examples

ABC6 <- ABC[,6:11]knotsGifi(ABC6, "Q")      ## tercile knotsknotsGifi(ABC6, "Q", 4)   ## quartile knotsknotsGifi(ABC6, "R")      ## 3 equally spaced interior knotsknotsGifi(ABC6, "E")      ## no interior knotsknotsGifi(ABC6, "D")      ## knots at the data points

Convert a data frame into a numeric matrix.

Description

Utility function for converting a data frame with factors (numeric and character levels), ordered factors, and numerical variables into a numeric matrix.

Usage

makeNumeric(x)

Arguments

x

Data frame

Value

A numeric matrix.

Examples

makeNumeric(ABC[,6:11])

Mammals dataset

Description

Dentition of mammals.

Usage

mammals

Format

A data frame with the tooth pattern, the number of top incisors, bottom incisors, top canines, bottom canines,top premolars, bottom premolars, top molars, and bottom molars.

- top incisors: (1) zero incisors; (2) one incisor; (3) two incisors; (4) three or more incisors.

- bottom incisors: (1) zero incisors; (2) one incisor; (3) two incisors; (4) three incisors; (5) fourincisors.

- top canine: (1) zero canines; (2) one canine.

- bottom canine: (1) zero canines; (2) one canine.

- top premolar (1) zero premolars; (2) one premolar; (3) two premolars; (3) two premolars; (4)three premolars; (5) four premolars.

- bottom premolar: (1) zero premolars; (2) one premolar; (3) two premolars; (3) two premolars;(4) three premolars; (5) four premolars.

- top molar: (1) zero, one or two molars; (2) more than two molars.

- bottom molar: (1) zero, one or two molars; (2) more than two molars.

References

Hartigan, J.A. (1975). Clustering Algorithms. New York: Wiley.

Examples

   data(mammals)   mammals

Multiple Regression (MORALS)

Description

Fits multiple regression within the Gifi framework.

Usage

morals(x, y, xknots = knotsGifi(x, "Q"), yknots = knotsGifi(y, "Q"), xdegrees = 2, ydegrees = 2, xordinal = TRUE, yordinal = TRUE, xties = "s", yties = "s", xmissing = "m", ymissing = "m", xactive = TRUE, xcopies = 1, itmax = 1000, eps = 1e-6, verbose = FALSE)

Arguments

x

Vector or data frame with predictor variables (all numeric)

y

Vector with response variable

xknots

Knots specification for predictors (seeknotsGifi)

yknots

Knots specification for response (seeknotsGifi)

xdegrees

Degree specification for predictors

ydegrees

Degree specification for response

xordinal

Whether predictors should be considered as ordinal or not. Alternatively, one can specify a boolean vector of length m denoting which variables should be ordinally restricted or not

yordinal

Whether response should be considered as ordinal or not

xties

How predictor ties should be handled: primary ("p"), secondary ("s"), or tertiary ("t")

yties

How response ties should be handled: primary ("p"), secondary ("s"), or tertiary ("t")

xmissing

How missing predictor values should be handled: multiple ("m"), single ("s"), or average ("a")

ymissing

How missing response values should be handled: multiple ("m"), single ("s"), or average ("a")

xactive

Which predictors should be active or inactive

xcopies

Number of copies for each predictor

itmax

Maximum number of iterations

eps

Convergence criterion

verbose

Iteration printout

Details

Fits MORALS as described in De Leeuw et al. (2017).

Value

rhat

Induced correlation matrix

objectscores

Object scores (rows)

xhat

Optimally transformed predictors

yhat

Optimally transformed response

ypred

Predicted (fitted) values

yres

Residuals

smc

Squared multiple correlation

ntel

Number of iterations

f

Loss function value

References

Gifi, A. (1990). Nonlinear Multivariate Analysis. New York: Wiley.

De Leeuw, J., Mair, P., Groenen, P. J. F. (2017). Multivariate Analysis with Optimal Scaling.

See Also

homals,princals,plot.morals

Examples

x <- scale(as.matrix(seq(0, pi, length = 20)), scale = FALSE)y <- scale(as.matrix(sin(x)), scale = FALSE)fitxy <- morals(x, y, xknots = knotsGifi(x, "E"), xdegrees = 2)plot(fitxy, main = c("x", "y"))plot(fitxy, plot.type = "resplot")plot(fitxy$xhat, fitxy$yhat)lines(fitxy$xhat, fitxy$ypred)plot(x, fitxy$yhat)lines(x, fitxy$ypred)

Neumann dataset

Description

Willard Gibbs discovered a theoretical formula connecting the density, thepressure, and the absolute temperature of a mixture of gases with convertible components. He applied this formula and the estimated constants to 65 experimentsof Neumann, and he discusses the systematic and accidental divergences (residuals).

Usage

neumann

Format

A data frame with temperature, pressure, and density on 65 experiments.

References

Gifi, A. (1990). Nonlinear multivariate analysis. New York: Wiley.Wilson, E.B. (1926). Empiricism and rationalism. Science, 64, 47-57

Examples

   data(neumann)   neumann

Plot Methods for Homals

Description

Various plotting options for objects of class"homals".

Usage

## S3 method for class 'homals'plot(x, plot.type = "jointplot", plot.dim = c(1, 2), var.subset = "all", col.points = rainbow_hcl(ncol(x$data)), col.scores = "gray", col.lines = 1:x$ndim, cex.scores = 0.8, cex.loadings = 0.8, labels.scores = FALSE, stepvec = NA, max.plot.array = NA, asp = 1, main, xlab, ylab, xlim, ylim, ...)

Arguments

x

Object of class"homals"

plot.dim

Vector with dimensions to be plotted.

plot.type

String indicating which type of plot to be produced:"jointplot","biplot","screeplot","transplot". See details.

var.subset

Numeric vector for subsetting variables to be plotted. If missing, all variables are taken into account

col.points

Color categories.

col.scores

Color object scores.

col.lines

Line colors for transformation and scree plot.

cex.scores

Size object scores.

cex.loadings

Size loading labels.

asp

Aspect ratio

labels.scores

Whether object score labels should be plotted.

stepvec

Vector whether step function should be plotted (see details).

max.plot.array

Number of panels in transformation plot.

main

Plot title.

type

Type of points/lines to be plotted.

xlab

Label of x-axis.

ylab

Label of y-axis.

xlim

Limits for x-axis.

ylim

Limits for y-axis.

...

Further plot arguments passed: seeplot

Details

Plot description:

- Biplot (plot.type = "biplot"): Biplot with the object scores and the category quantifications.

- Transformation plot (plot.type = "transplot"): Plots the original scale against thetransformed scale (first dimension) for each variable separately.

- Joint plot (plot.type = "jointplot"): Plots the category quantifications.

- Scree plot (plot.type = "screeplot"): Produces a scree plot based on the eigenvalues.

For transformation plots only: Ifstepvec = NA, the function tries to figure out which variable should be plotted as step function. Alternatively, a boolean vector (with length number of variables) can be specified (TRUE step function,FALSE smooth function).

Examples

fithart <- homals(hartigan, ndim = 3, normobj.z = FALSE)fithartplot(fithart)   plot(fithart, var.subset = c(1,2,4), plot.dim = c(2,3))plot(fithart, plot.type = "biplot", col.scores = "black")plot(fithart, plot.type = "biplot", col.scores = "black", labels.scores = TRUE, col.points = 1:6)plot(fithart, plot.type = "screeplot", col.lines = "red")plot(fithart, plot.type = "transplot", plot.dim = 1:3, col.lines = c(1, 2, 4))plot(fithart, plot.type = "transplot", stepvec = rep(FALSE, 6), max.plot.array = c(2,2))

Plot Methods for Morals

Description

Various plotting options for objects of class"morals".

Usage

## S3 method for class 'morals'plot(x, plot.type = "transplot", var.subset = "all", col.lines = "black", stepvec = NA, max.plot.array = c(2, 2), main, xlab, ylab, xlim, ylim, ...)

Arguments

x

Object of class"morals"

plot.type

String indicating which type of plot to be produced:"resplot","transplot"

var.subset

Numeric vector for subsetting variables to be plotted. If missing, all variables are taken into account. Ignored for non separate variable plots.

col.lines

Line colors for transformation

stepvec

Vector whether step function should be plotted

max.plot.array

Number of panels in transformation plot.

main

Plot title.

type

Type of points/lines to be plotted.

xlab

Label of x-axis.

ylab

Label of y-axis.

xlim

Limits for x-axis.

ylim

Limits for y-axis.

...

Further plot arguments passed: seeplot

Details

Plot description:The transformation plot (plot.type = "transplot"): Plots the original scale against the transformed scale for each variable separately.

Examples

x <- scale(as.matrix(seq(0, pi, length = 20)), scale = FALSE)y <- scale(as.matrix(sin(x)), scale = FALSE)fitxy <- morals(x, y, xknots = knotsGifi(x, "E"), xdegrees = 2)plot(fitxy, main = c("x", "y"))plot(fitxy, plot.type = "resplot")

Plot Methods for Princals

Description

Various plotting options for objects of class"princals".

Usage

## S3 method for class 'princals'plot(x, plot.type = "loadplot", plot.dim = c(1, 2), var.subset = "all", col.scores = "black", col.loadings = "black", col.lines = "black", cex.scores = 0.8, cex.loadings = 0.8, stepvec = NA, max.plot.array = NA, expand = 1, asp = 1, main, xlab, ylab, xlim, ylim, ...)

Arguments

x

Object of class"princals"

plot.type

String indicating which type of plot to be produced:"biplot","loadplot","screeplot","transplot". See details.

plot.dim

Vector with dimensions to be plotted.

var.subset

Numeric vector for subsetting variables to be plotted. If missing, all variables are taken into account. Ignored for non separate variable plots.

col.scores

Color object scores.

col.loadings

Color loading vectors.

col.lines

Line colors for transformation and scree plot.

cex.scores

Size object scores.

cex.loadings

Size loading labels.

asp

Aspect ratio

stepvec

Vector whether step function should be plotted (see details).

max.plot.array

Number of panels in transformation plot.

expand

Expansion factor for loadings in biplot.

main

Plot title.

type

Type of points/lines to be plotted.

xlab

Label of x-axis.

ylab

Label of y-axis.

xlim

Limits for x-axis.

ylim

Limits for y-axis.

...

Further plot arguments passed: seeplot

Details

Plot description:

- Biplot (plot.type = "biplot"): Biplot with the object scores and the loadings. It usesbiplot.default fromstats internally (see corresponding help file for additional arguments)

- Transformation plot (plot.type = "transplot"): Plots the original scale against thetransformed scale (first dimension) for each variable separately.

- Loadings plot (plot.type = "loadplot"): Plots the loadings of the variables and connects them with the origin.

- Scree plot (plot.type = "screeplot"): Produces a scree plot based on the eigenvalues.

For transformation plots only: Ifstepvec = NA, the function tries to figure out which variable should be plotted as step function. Alternatively, a boolean vector (with length number of variables) can be specified (TRUE step function,FALSE smooth function).

Examples

ABC6 <- ABC[,6:11]fitord <- princals(ABC6, ndim = 3)  ## 3D princals solution## transformation plotplot(fitord, plot.type = "transplot", var.subset = 1:4, lwd = 2, col.lines = "coral")## loadings plotplot(fitord, "loadplot", main = "Loadings Plot ABC Data")## biplotplot(fitord, "biplot", main = "Biplot ABC Data", cex.scores = 0.5)  plot(fitord, "biplot", main = "Biplot ABC Data")plot(fitord, "biplot", main = "Biplot ABC Data", plot.dim = c(2,3))## scree plotplot(fitord, "screeplot")

Categorical principal component analysis (PRINCALS).

Description

Fits a categorical PCA. The default is to take each input variable as ordinal but it works for mixed scale levels (incl. nominal) as well. Through a proper spline specification various continuous transformation functions can be specified: linear, polynomials, and (monotone) splines.

Usage

princals(data, ndim = 2, levels = "ordinal", ordinal, knots, ties = "s", degrees = 1, copies = 1, missing = "s", normobj.z = TRUE, active = TRUE,itmax = 1000, eps = 1e-06, verbose = FALSE)

Arguments

data

Input data frame: n observations, m variables

ndim

Number of dimensions to be computed

levels

A vector of length m denoting basic scale levels ("nominal","ordinal","metric"; see details

ordinal

If knots are specified manually, a boolean vector of length m denotes which variables should be ordinally restricted or not (see details)

knots

Scale levels can be specified manually using splines (seeknotsGifi). If knots is set, this overrideslevel (see details)

ties

How ties should be handled: primary ("p"), secondary ("s"), or tertiary ("t")

degrees

Spline degrees. If different degrees should be used across variables, a vector of length m can be specified.

copies

Number of copies for each variables (also as vector of length m)

missing

How missing values should be handled: multiple ("m"), single ("s"), or average ("a")

active

Which variables should be active or inactive (also as vector of length m)

normobj.z

IfTRUE, object scores are z-scores, ifFALSE, they are restriction to SS of 1.

itmax

Maximum number of iterations

eps

Convergence criterion

verbose

Iteration printout

Details

The measurement (or scale) levels of the variables are incorporated via spline transformations. If the user only needs simple scale levels like nominal, ordinal, and metric, a corresponding vector can be specified in thelevels argument without settingknots andordinal. The corresponding spline transformations (unrestricted, monotone, and linear) are then created internally. If all scale level transformations are the same,ordinal can be a single value. For more advanced transformations such as polynomial or more flexible splines, theknots andordinal arguments need to be specified instead oflevels.

Value

transform

Optimally transformed scores

rhat

Induced correlation matrix

evals

Eigenvalues of induced correlation matrix

objectscores

Object scores (rows)

scoremat

Optimally scaled data matrix (first dimension)

quantifications

Category quantifications

dmeasures

Discimination matrices

lambda

Average discrimination matrix

weights

Component weights

loadings

Component loadings

ntel

Number of iterations

f

Loss function value

data

Original data frame

datanum

Numerical data frame

ndim

Number of extracted dimensions

call

Function call

References

Gifi, A. (1990). Nonlinear Multivariate Analysis. New York: Wiley.

De Leeuw, J., Mair, P., Groenen, P. J. F. (2017). Multivariate Analysis with Optimal Scaling.

See Also

homals,plot.princals

Examples

ABC6 <- ABC[,6:11]## ordinal PCAfitord <- princals(ABC6)  ## ordinal PCAfitordsummary(fitord)plot(fitord, plot.type = "transplot")plot(fitord, "loadplot", main = "Loadings Plot ABC Data")  ## aspect ratio = 1plot(fitord, "biplot", main = "Biplot ABC Data")plot(fitord, "screeplot")## linear restrictions (mimics standard PCA)abc_knots <- knotsGifi(ABC6, "E")     ## 0 interior knotsfitlin <- princals(ABC6, knots = abc_knots, ordinal = TRUE)  fitlin fitlin$evalsplot(fitlin, plot.type = "transplot")## compare with standard PCAABCnum <- makeNumeric(ABC6)fitpca <- prcomp(ABCnum, scale = TRUE)fitpca$sdev^2   ## more complicated specifications## Not run: data(epi.bfi, package = "psychTools")epi6 <- epi.bfi[,1:6]fitepi1 <- princals(epi6, knots = knotsGifi(epi6, "Q"))    ## monotone splines (degree 2)fitepi1plot(fitepi1, "transplot")## no interior knots vars 1 and 2; data knots vars 3 and 4; 5 ## interior percentile knots var 5; no interior knots var 6)knotList <- c(knotsGifi(epi6[,1:2], "E"),               knotsGifi(epi6[,3:4], "D"),               knotsGifi(epi6[,5], "Q", n = 5),              knotsGifi(epi6[,6], "E"))knotList  ordvec <- c(TRUE, FALSE, TRUE, FALSE, FALSE, TRUE) ## ordinal restrictionsdegvec <- c(3, -1, 2, 2, 3, 1)                     ## spline degrees (second variable nominal)fitepi2 <- princals(epi6, knots = knotList, ordinal = ordvec, degrees = degvec)fitepi2plot(fitepi2, "transplot")## End(Not run)

Roskam dataset

Description

The Department of Psychology at the University of Nijmegen had 9 differentareas of research and teaching. Each of the 39 psychologists working in thedepartment ranked all 9 areas in order of relevance for their work.

Usage

roskam

Format

A data frame with the following 9 areas:

SOC: Social Psychology

EDU: Educational and Developmental Psychology

CLI: Clinical Psychology

MAT: Mathematical Psychology and Psychological Statistics

EXP: Experimental Psychology

CUL: Cultural Psychology and Psychology of Religion

IND: Industrial Psychology

TST: Test Construction and Validation

PHY: Physiological and Animal Psychology

References

Roskam, E (1968). Metric Analysis of Ordinal Data in Psychology. PhDthesis, University of Leiden.

Examples

   data(roskam)   roskam

Senate votes 2007

Description

2007 senate votes on 20 issues selected by Americansfor Democratic Action. The votes selected cover a full spectrum of domestic, foreign, economic,military, environmental and social issues. We tried to select votes whichdisplay sharp liberal/conservative contrasts and coded them accordingly. In many instances we have chosenprocedural votes: amendments, motions to table, or votes on rules for debate. Oftenthese votes reveal true attitudes frequently obscured in the final votes.

Usage

senate07

Format

A data frame (98 senators) with the following variables:

Party: R = Republican, D = Democrat, I = Independent.

I1. S 1. Ethics and Lobbying Overhaul: Grass-Roots Lobbying Bennett (R-UT)amendment to Reid (D-NV) ethics reform legislation. Reid's legislation would overhaulCongressional lobbying and ethics rules for Senators and their staffs, restrict use ofmore broadly defi ned earmarks, prohibit Senators and staff from accepting giftsand free meals, extend the period before former Senators can become lobbyists,prohibit lobbyist-funded travel, and require trips funded by private entities to be vettedby the Select Ethics Committee. The Bennett amendment, permitting the travelof Members of Congress hosted by 501 (c) (3), or 'grass-roots lobbying' organizations,was adopted 51-46. Jan. 17, 2007. A no vote is a 1.

I2. HR 2. Minimum Wage Increase: Motion to invoke cloture (thus limiting debate) ona Baucus (D-MT) substitute amendment to raise the minimum wage to $7.25 per hourover two years and provide $8.3 billion in small-business tax incentives. The taxprovisions would be offset with revenue increases, including a $1 million cap onthe amount of executive compensation that can be tax-deferred in any year and extendcertain restrictions on certain sale-in-leaseout deals. (Three-fifths of the total Senate,60 votes, is required to invoke cloture.) Motion agreed to 87-10. Jan 30, 2007. Ayes vote is a 1.

I3. S 574. Iraq War 'Surge': Motion to invoke cloture and proceed to a bill thatwould express the sense of Congress in support of U.S. military serving in Iraq,while disapproving of President Bush's 'surge' decision to deploy more than20000 additional U.S. combat troops to that country and requiring the President tosubmit a report to Congress every 30 days on military progress in Iraq. Motion rejected56-34. Feb. 17, 2007. A yes vote is a 1.

I4. S J Res 9. Iraq Mission: Passage of a joint resolution to limit the mission of U.S.forces in Iraq, within 120 days of enactment, to counter-terrorism efforts, training Iraqiforces and protecting U.S. assets. It would set a binding goal of withdrawing mostcombat troops by March 31, 2008. (By unanimous consent, the Senate agreed torequire 60 votes to pass the joint resolution.) Rejected 48-50. March 15, 2007. A yesvote is a 1.

I5. S 3. Medicare Prescription Drug Price Negotiation: Motion to invoke clotureand proceed to a bill allowing the Health and Human Services Department to negotiatethe prices drug companies charge under the Medicare Part D prescription drug program.Motion rejected 55-42. April 18, 2007. A yes vote is a 1.

I6. HR 1495. Water Resources DevelopmentAct Reauthorization - Climate Change: Kerry (D-MA) amendment to Boxer (D-CA)legislation authorizing about $14 billion for Army Corps of Engineers water resourcesdevelopment projects, including initiatives for storm protection in Louisiana, fl oodcontrol, and ecosystem restoration. The Kerry amendment would require the ArmyCorps of Engineers to include the impact on global climate change in any relevant studyof water resource projects.(By unanimous consent, the Senate agreed to require 60votes to adopt the amendment.) Rejected 51-42. May 15, 2007. A yes vote is a 1.

I7. S 1348. Immigration Overhaul: Motion to invoke cloture on Kennedy (D-MA)legislation to overhaul U.S. immigration policies and institute new border securitymeasures, including an electronic verification system. It would allocate somegreen cards on a 'merit-based' system based on certain criteria, including a highdemandoccupation, profi ciency in English, and higher education degrees. Half of thegreen cards would be allocated based on family relations. It also would provide fora temporary guest worker program that would allow workers to remain in the UnitedStates for up to six years, provided that they return to their home country for a year afterevery two years they remain in the United States. A 'yea' was a vote in support ofKennedy's and the President's position. Motion rejected 45-50. June 7, 2007. A yesvote is a 1.

I8. HR 800. EFCA: Motion to invoke cloture on the Reid (D-NV) motion to proceed toa bill that would allow union organizers to bypass an NLRB-sponsored electionif a majority of eligible employees sign a petition in support of a union. Motionrejected 51-48. June 26, 2007. A yes vote is a 1.

I9. HR 1585. Fiscal 2008 Defense Authorization: Motion to invoke clotureon a Levin (D-MI) amendment mandating a drawdown and redeployment of U.S.forces in Iraq by the end of April 2008, except to protect U.S. personnel, trainIraqi security forces, and conduct counter terrorism operations against al Qaeda andother international terrorist organizations. Redeployment would begin within 120days of enactment. The bill would authorize $648.3 billion for defense programs infiscal 2008, including $127.5 billion for the wars in Iraq and Afghanistan. Italso would authorize $143.5 billion for operations and maintenance; $109.9 billionfor procurement; $122.9 billion for military personnel, and $74.7 billion for research,development, testing and evaluation. Motion rejected 52-47. July 18, 2007. Ayes vote is a 1.

I10. S 2011. FISA: Passage of a bill to amend the Foreign Intelligence SurveillanceAct of 1978 (FISA) to expand the authority of the Attorney General and the Director ofNational Intelligence to conduct surveillance of communication between one suspectedforeign terrorist and another without a court warrant. Communications companieswould be compelled to comply with the government's conduct of such surveillance.Within 10 days of initiating the electronic surveillance, the Administration would berequired to describe to the FISA court the procedures they used to determine whetherthe intelligence acquisition being conducted without a warrant is directed at foreigntargets overseas. The FISA court would then rule on the procedures. The bill wouldsunset after six months. (By unanimous consent, the Senate agreed to require 60votes to pass the bill.) Rejected 43-45. Aug. 3, 2007. A yes vote is a 1.

I11. S 1257. District of Columbia Voting Rights Motion to invoke cloture on a Reid(D-NV) motion to proceed to a bill to increase the membership of the House ofRepresentatives to 437, by granting a seat to the District of Columbia and an additionalseat to Utah. Motion rejected 57-42. Sept. 19, 2007. A yes vote is a 1.

I12.HR 1585. Fiscal 2008 Defense Authorization: Motion to invoke clotureon the Kennedy (D-MA) amendment to Levin (D-MI) legislation (see vote No. 9,above). The Kennedy amendment would make violent crimes that cause bodily harmbased on the victim's race, color, religion or national origin punishable by a fi ne and upto 10 years in prison, and punishable by a life sentence if the victim dies, is kidnappedor subjected to aggravated sexual abuse. It also would create the same penaltiesfor crimes motivated by gender, sexual orientation, gender identity, or disability.(Subsequently, the Kennedy amendment was adopted by voice vote.) Motion agreedto 60-39. Sept. 2007. A yes vote is a 1.

I13. HR 976. SCHIP: Motion to invoke cloture on the Reid (D-NV) motion toagree to the House bill reauthorizing the State Children's Health Insurance Program(SCHIP) at nearly $60 billion over five years, expanding the program by $35billion. To offset the cost of the expansion, the bill would increase the tax on cigarettesby 61 cents to $1 per pack and raise taxes on other tobacco products. Motion agreed to69-30. Sept. 27, 2007. A yes vote is a 1.

I14. HR 3043. Fiscal 2008 Labor - HHS-Education Appropriations - Limiting Abortion Funding: Vitter (R-LA) amendment to Harkin (D-IA) legislation. The Vitter amendment would prohibit thedistribution of Title X family planning funds to abortion providers except when a womansuffers from a physical disorder, injury, or illness that would risk the life of themother unless an abortion is provided. The amendment would not apply to hospitals.Harkin's legislation would appropriate $605.5 billion in fiscal 2008, including$149.9 billion in discretionary spending, for the departments of Labor, Health andHuman Services (HHS), and Education, and for related agencies. It would provide $63billion for the Education Department, $14.9 billion for the Labor Department and $479.1billion for HHS. Rejected 41-52. Oct. 18, 2007. A no vote is a 1.

I15. Southwick Nomination: Motion to invoke cloture on the nomination of LeslieSouthwick of Mississippi to be a judge for the 5th Circuit Court of Appeals. Opponentsargued that, in his positions related to African Americans, workers, gays, andwomen, Mr. Southwick was unsuited to a lifetime appointment to the federal judiciary.Motion agreed to 62-35. Oct. 24, 2007. A no vote is a 1.

I16. HR 1495. Water Resources Development - Veto Override: Passage, over President Bush's Nov. 2, 2007, veto, of a bill authorizing $23.2 billion for more than900 water resource development projects and studies by the Army Corps of Engineersfor flood control, navigation, beach erosion control, and environmental restoration. Thebill would require independent peer review for certain projects that exceed $40 million.It would authorize $3.9 billion for a system of new locks and dams and environmentalrestoration for the Upper Mississippi River and Illinois waterway system. It also wouldauthorize hurricane recovery activities along the Gulf Coast. (A two-thirds majority ofthose present and voting of both chambers - 62 senators in this instance - is requiredto override a veto.) Passed, thus enacted into law, 79-14. Nov. 8, 2007. A yes vote isa 1.

I17.HR 3688. U.S.-Peru Trade Agreement: Passage of a bill that would implement aNAFTA/CAFTA model trade agreement between the United States and Peru. Theagreement would reduce most tariffs and duties currently affecting trade betweenthe two countries, increase protections for intellectual property and would requirePeru to take steps to strengthen its labor and environmental-enforcement standards.Passed, thus cleared for the President, 77-18. Dec. 4, 2007. A no vote is a 1.

I18. HR 3996. AMT Adjustment: Motion to invoke cloture on a Reid (D-NV) motionto proceed to the bill that would provide a one-year adjustment to the alternativeminimum tax (AMT) on 2007 income, exempt an additional 21 million taxpayersfrom paying the AMT, extend several expiring tax provisions for one year, andexpand eligibility in 2008 for the refundable child tax credit. To offset the cost, the billincludes revenue raisers, such as increasing the tax on the carried interest of privateequity managers, venture capitalists and some real estate investors. Motion rejected46-48. Dec. 6, 2007. A yes vote is a 1.

I19. HR 6. Energy Policy: Motion to invoke cloture on the Reid (D-NV) motion toconcur in the House bill with an additional amendment to require new CorporateAverage Fuel Economy standards of 35 miles per gallon for cars and light trucks,and require the production and use of 36 billion gallons of biofuels by 2022. It woulddirect the Energy Department to set new energy efficiency standards. The additionalamendment would strike a provision requiring utilities to produce 15 percent oftheir electricity from alternative sources by 2020. It also would increase to $21.8 billiona package of tax incentives that would be offset in part by eliminating or reducing$13 billion in subsidies for major oil and gas companies. Motion rejected 59-40. Dec.13, 2007. A yes vote is a 1.

I20. HR 2419. Farm Bill Reauthorization Passage of a bill to authorize $286 billionfrom fiscal 2008 through fiscal 2012 for federal farm, nutrition assistance,rural development, and agricultural trade programs. Producers would not be eligibleif the average of their three-year adjusted gross income is more than $1 million in2009, and more than $750,000 in 2010 and subsequent years, unless at least two-thirdsof that income is derived from agriculture. The bill also would limit the amount thatfarms could receive during any crop year under specific programs to $40,000 fordirect and fi xed payments, and $60,000 for counter-cyclical and average crop revenuepayments. It would create a new optional subsidy called the Average Crop Revenueprogram, which would tie payments to state based farm revenue figures. Country-of-originlabels for all meat would be required by September 2008. The bill would extendthe Milk Income Loss Contract program through fiscal 2012. It would increase,from $134 to $140 per month, the amount households could deduct from gross incomein determining their level of food stamp benefits. It also would authorize $1.1billion to promote farm-based renewable energy and effi ciency. (Before passage, theSenate adopted a Harkin (D-IA) substitute amendment by voice vote.) Passed 79-14.Dec. 14, 2007. A yes vote is a 1.

Examples

   data(senate07)   senate07

Sleeping Bags

Description

This data set provides 4 variables measured on 21 sleeping bags. The variables are temperature,weight, price, and material.

Usage

sleeping

Format

A data frame of dimenson 21 times 4.

References

Prediger, S. (1997). Symbolic objects in formal concept analysis. In G. Mineau, and A. Fall (eds.), Proceedings of the 2nd International Symposium on Knowledge, Retrieval,Use, and Storage for Efficiency.

Examples

   data(sleeping)   sleeping

Small dataset

Description

A small artifical dataset.

Usage

small

Format

A data frame with 3 variables each of them has 3 categories.

References

Gifi, A. (1990). Nonlinear Multivariate Analysis: Wiley.

Examples

   data(small)   small

[8]ページ先頭

©2009-2025 Movatter.jp