psychotree/0000755000176200001440000000000014051776053012447 5ustar liggesuserspsychotree/NAMESPACE0000644000176200001440000000254513063735655013701 0ustar liggesusers## imported packages (with generics etc.) import( "stats", "graphics", "psychotools", "partykit", "Formula" ) importFrom("grid", "gpar", "grid.layout", "unit", "grid.lines", "grid.points", "grid.polyline", "grid.rect", "grid.text", "grid.xaxis", "grid.yaxis", "popViewport", "pushViewport", "upViewport", "viewport" ) importFrom("grDevices", "extendrange", "gray.colors") export( ## trees "raschtree", "rstree", "pctree", "bttree", "mpttree", ## panel-generating visualization functions "node_profileplot", "node_regionplot", "node_btplot", "node_mptplot" ) ## methods for raschtree objects S3method("plot", "raschtree") S3method("print", "raschtree") S3method("predict", "raschtree") S3method("itempar", "raschtree") ## methods for rstree objects S3method("plot", "rstree") S3method("print", "rstree") S3method("predict", "rstree") S3method("itempar", "rstree") S3method("threshpar", "rstree") ## methods for pctree objects S3method("plot", "pctree") S3method("print", "pctree") S3method("predict", "pctree") S3method("itempar", "pctree") S3method("threshpar", "pctree") ## methods for bttree objects S3method("plot", "bttree") S3method("predict", "bttree") S3method("print", "bttree") S3method("itempar", "bttree") ## methods for mpttree objects S3method("coef", "mpttree") S3method("plot", "mpttree") S3method("print", "mpttree") psychotree/data/0000755000176200001440000000000012506774003013354 5ustar liggesuserspsychotree/data/DIFSim.rda0000644000176200001440000000263712041276503015123 0ustar liggesusersBZh91AY&SY0sP?ݐPP@@P}4Bhɒ # QLDA$"$h4 z hiFA2h&F!HT44 hiFA2h&F!JddɐёdL LE* £j fc0"W{7ax8wv$%6yϊLIfdhF9uuQu8襔ږVVI2*K -uۍChd5ceE,}H [SDX(1PbQ/J "`1OS]}rzĐ9QF""n+:tM{ڣV ^)%jYDVڼE_i$@NZGvR)zӈPjTMY=`DE2 l&C5D8(G^QWD@#y~N$9\7 ň!K!ks""؂֖ !@B("A* 訃0DPl ~&U(R # dAS@E X4XÛlRgCnDHT=ڐ~k4le- - ll1"J5erv t"bUfکimPgSií,Vb,.&8^b`N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/.0$G\OzN~$S?t`}Gpvݏ 08]Ώ?}b8o0'jdyG6a"([WݵoŞ:?rKO9_ŶoNm>'7r%k]yI^o?VHyٷc}/7]v~0bz{aSC)ȍ<rctp䣝A726Aۨv:*F0_(s:.{g0~D~b/Sy ihFe/WKoSa\mDcUo6qż<~je~j|":F$;\<siTrż8~Cν}SO0O3.{ss9c;bb9α&s-ډFƐ7}=Fiݓzq"'A`>Wo_lnoP_q0UHvހ?=m68mMo޾Wog7oyQeoVjw7.n* UYpsychotree/man/0000755000176200001440000000000014051746050013214 5ustar liggesuserspsychotree/man/node_regionplot.Rd0000644000176200001440000000651113150114530016664 0ustar liggesusers\name{node_regionplot} \alias{node_regionplot} \alias{node_effects} \title{Panel-Generating Function for Visualizing Rasch, Rating Scale and Partial Credit Tree Models} \description{ Panel-generating function for visualizing the absolute item threshold parameters from the nodes in rasch, rating scale and partial credit tree models. } \usage{ node_regionplot(mobobj, names = FALSE, abbreviate = TRUE, type = c("mode", "median", "mean"), ref = NULL, ylim = NULL, off = 0.1, col_fun = gray.colors, bg = "white", uo_show = TRUE, uo_col = "red", uo_lty = 2, uo_lwd = 1.25, ylines = 2) } \arguments{ \item{mobobj}{an object of class \code{"mob"} based on rasch models fitted by \code{\link[psychotools]{raschmodel}}, rating scale models fitted by \code{\link[psychotools]{rsmodel}} or partial credit models fitted by \code{\link[psychotools]{pcmodel}}.} \item{names}{logical or character. If \code{TRUE}, the names of the items are displayed on the x-axis. If \code{FALSE}, numbers of items are shown. Alternatively a character vector of the same length as the number of items can be supplied.} \item{abbreviate}{logical. Should item names be abbreviated? If numeric this controls the length of the abbreviation.} \item{type}{character, specifying which type of threshold parameters are to be used to mark the category regions per item in the plot (see \code{\link[psychotools]{regionplot}} for details).} \item{ref}{a vector of labels or position indices of item parameters which should be used as restriction/for normalization. If \code{NULL} (the default), all items are used (sum zero restriction). See \code{\link[psychotools]{threshpar}} for more details.} \item{ylim}{y axis limits} \item{off}{numeric, the distance (in scale units) between two item rectangles.} \item{col_fun}{function. Function to use for creating the color palettes for the rectangles. Per default \code{gray.colors} is used. Be aware that \code{col_fun} should accept as first argument an integer specifying the number of colors to create.} \item{bg}{color for background filling.} \item{uo_show}{logical. If set to \code{TRUE} (the default), disordered absolute item threshold parameters are indicated by a horizontal line (only if \code{type} is set to \code{"mode"}).} \item{uo_col}{character, color of indication lines (if \code{uo_show}).} \item{uo_lty}{numeric. Line typ of indication lines (if \code{uo_show}).} \item{uo_lwd}{numeric. Line width of indication lines (if \code{uo_show}).} \item{ylines}{numeric. Number of lines used for y-axis labels.} } \details{ The panel-generating function \code{node_regionplot} is called by the \code{plot} method of \code{"rstree"} and \code{"pctree"} objects by default and does not have to be called by the user directly. See \code{\link[psychotools]{regionplot}} for details and references of the drawn region plots and possible values and their meaning for the argument \code{type} (taken by \code{node_regionplot}). Prior to version 0.13-1, \code{node_regionplot} was called \code{node_effects}. } \value{ A panel function which can be supplied to the \code{plot} method for \code{"mob"} objects. } \seealso{\code{\link{raschtree}}, \code{\link{rstree}}, \code{\link{pctree}}, \code{\link[psychotools]{regionplot}}} \keyword{hplot} psychotree/man/Topmodel2007.Rd0000644000176200001440000000514314051746050015602 0ustar liggesusers\name{Topmodel2007} \alias{Topmodel2007} \encoding{latin1} \title{Attractiveness of Germany's Next Topmodels 2007} \description{ Preferences of 192 respondents judging the attractiveness of the top six contestants of the TV show \emph{Germany's Next Topmodel 2007} (second cycle). } \usage{data("Topmodel2007")} \format{ A data frame containing 192 observations on 6 variables. \describe{ \item{preference}{Paired comparison of class \code{\link{paircomp}}. Preferences for all 15 paired comparisons from 6 contestants: Barbara, Anni, Hana, Fiona, Mandy, and Anja.} \item{gender}{Factor coding gender.} \item{age}{Integer. Age of the respondents in years.} \item{q1}{Factor. Do you recognize the women on the pictures?/Do you know the TV show Germany's Next Topmodel?} \item{q2}{Factor. Did you watch Germany's Next Topmodel regularly?} \item{q3}{Factor. Did you watch the final show of Germany's Next Topmodel?/Do you know who won Germany's Next Topmodel?} } } \details{ Germany's Next Topmodel is a German casting television show (based on a concept introduced in the United States) hosted by Heidi Klum (see Wikipedia 2009). The second season of the show aired March--May 2007. A survey was conducted at the Department of Psychology, Universitt Tbingen, in 2007 shortly after the final show. The sample was stratified by gender and age (younger versus older than 30 years) with 48 participants in each group. Digital photographs (resolution 303 times 404 pixels) of the top six contestants were available from the ProSieben web page at the time of the survey. The photos were selected to be comparable, showing the contestant's face and the upper part of the body, all women being casually dressed. Participants were presented with all 15 pairs of photographs. On each trial, their task was to judge which of the two women on the photos was the more attractive. In order to assess the participants' expertise, additional questions regarding their familiarity with the show were asked after the pairwise comparisons were completed. The actual ranking, as resulting from sequential elimination during the course of the show, was (from first to sixth place): Barbara, Anni, Hana, Fiona, Mandy, Anja. } \references{ Wikipedia (2009). Germany's Next Topmodel -- Wikipedia, The Free Encyclopedia. \url{https://en.wikipedia.org/wiki/Germany's_Next_Topmodel}, accessed 2009-02-06. } \seealso{\code{\link{paircomp}}} \examples{ data("Topmodel2007", package = "psychotree") summary(Topmodel2007$preference) xtabs(~ gender + I(age < 30), data = Topmodel2007) } \keyword{datasets} psychotree/man/EuropeanValuesStudy.Rd0000644000176200001440000000623714051753331017502 0ustar liggesusers\name{EuropeanValuesStudy} \alias{EuropeanValuesStudy} \title{European Values Study} \description{ A sample of the 1999 European Values Study (EVS) containing an assessment of materialism/postmaterialism in 3584 respondents from 32 countries. } \usage{data("EuropeanValuesStudy")} \format{ A data frame containing 3584 observations on 10 variables. \describe{ \item{country}{Factor coding the country of a respondent.} \item{gender}{Factor coding gender.} \item{birthyear}{Numeric. Year of birth.} \item{eduage}{Numeric. Age when full time education was or will be completed.} \item{marital}{Factor. Current legal marital status.} \item{employment}{Ordered factor. Employment and number of working hours.} \item{occupation}{Factor. What is/was your main job?} \item{income}{Ordered factor. Income of household in ten categories from 10 percent lowest to 10 percent highest income category.} \item{paircomp}{Paired comparison of class \code{\link{paircomp}}. Five pairwise choices among four important political goals derived from a double-choice task (see Details).} \item{country2}{Factor. Country group according to postmaterialism (see Details).} } } \details{ The data are part of a larger survey conducted in 1999 in 32 countries in Europe (see \url{https://europeanvaluesstudy.eu/}). Vermunt (2003) obtained a sample from 10 percent of the available cases per country, yielding 3584 valid cases. The item in the 1999 European Values Study questionnaire aiming at recording materialism/postmaterialism reads as follows: There is a lot of talk these days about what the aims of this country should be for the next ten years. On this card are listed some of the goals which different people would give top priority. If you had to choose, which of the things on this card would you say is most important? And which would be the next most important? A Maintaining order in the nation\cr B Giving people more say in important government decisions\cr C Fighting rising prices\cr D Protecting freedom of speech The double-choice task implies a partial ranking of the alternatives and (assuming transitivity) an incomplete set of paired comparisons for each respondent. The country group according to postmaterialism was derived by Vermunt (2003) using a latent class model, and applied by Lee and Lee (2010) in a tree model. } \source{ Latent GOLD Sample Data Sets Website. } \references{ Lee PH, Yu PLH (2010). Distance-Based Tree Models for Ranking Data. \emph{Computational Statistics and Data Analysis}, \bold{54}, 1672--1682. Vermunt JK (2003). Multilevel Latent Class Models. \emph{Sociological Methodology}, \bold{33}, 213--239. } \seealso{\code{\link{paircomp}}} \examples{ ## data data("EuropeanValuesStudy", package = "psychotree") summary(EuropeanValuesStudy$paircomp) \dontrun{ ## Bradley-Terry tree resulting in similar results compared to ## the (different) tree approach of Lee and Lee (2010) evs <- na.omit(EuropeanValuesStudy) bt <- bttree(paircomp ~ gender + eduage + birthyear + marital + employment + income + country2, data = evs, alpha = 0.01) plot(bt, abbreviate = 2) } } \keyword{datasets} psychotree/man/SPISA.Rd0000644000176200001440000001553713614374232014400 0ustar liggesusers\name{SPISA} \alias{SPISA} \encoding{latin1} \title{SPIEGEL Studentenpisa Data (Subsample)} \description{ A subsample from the general knowledge quiz \dQuote{Studentenpisa} conducted online by the German weekly news magazine SPIEGEL. The data contain the quiz results from 45 questions as well as sociodemographic data for 1075 university students from Bavaria. } \usage{data("SPISA")} \format{ A data frame containing 1075 observations on 6 variables. \describe{ \item{spisa}{matrix with \code{0}/\code{1} results from 45 questions in the quiz (indicating wrong/correct answers).} \item{gender}{factor indicating gender.} \item{age}{age in years.} \item{semester}{numeric indicating semester of university enrollment.} \item{elite}{factor indicating whether the university the student is enrolled in has been granted \dQuote{elite} status by the German \dQuote{excellence initiative}.} \item{spon}{ordered factor indicating frequency of accessing the SPIEGEL online (SPON) magazine.} } } \details{ An online quiz for testing one's general knowledge was conducted by the German weekly news magazine SPIEGEL in 2009. Overall, about 700,000 participants answered the quiz and a set of sociodemographic questions. The general knowledge quiz consisted of a total of 45 items from five different topics: politics, history, economy, culture and natural sciences. For each topic, four different sets of nine items were available, that were randomly assigned to the participants. A thorough analysis and discussion of the original data set is provided in Trepte and Verbeet (2010). Here, we provide the subsample of university students enrolled in the federal state of Bavaria, who had been assigned questionnaire number 20 (so that all subjects have answered the same set of items). Excluding all incomplete records, this subsample contains 1075 observations. The data are analyzed in Strobl et al. (2010), whose analysis is replicated in \code{vignette("raschtree", package = "psychotree")}. The full list of items in questionnaire 20 is given below. Politics:\cr Who determines the rules of action in German politics according to the constitution? -- The Bundeskanzler (federal chancellor).\cr What is the function of the second vote in the elections to the German Bundestag (federal parliament)? -- It determines the allocation of seats in the Bundestag.\cr How many people were killed by the RAF (Red Army Faction)? -- 33.\cr Where is Hessen (i.e., the German federal country Hesse) located? -- (Indicate location on a map.)\cr What is the capital of Rheinland-Pfalz (i.e., the German federal country Rhineland-Palatinate)? -- Mainz.\cr Who is this? -- (Picture of Horst Seehofer.)\cr Which EU institution is elected in 2009 by the citizens of EU member countries? -- European Parliament.\cr How many votes does China have in the UNO general assembly? -- 1.\cr Where is Somalia located? -- (Indicate location on a map.) History:\cr The Roman naval supremacy was established through... -- ... the abolition of Carthage.\cr In which century did the Thirty Years' War take place? -- The 17th century.\cr Which form of government is associated with the French King Louis XIV? -- Absolutism.\cr What island did Napoleon die on in exile? -- St. Helena.\cr How many percent of the votes did the NSDAP receive in the 1928 elections of the German Reichstag? -- About 3 percent.\cr How many Jews were killed by the Nazis during the Holocaust? -- About 6 Million.\cr Who is this? -- (Picture of Johannes Rau, former German federal president.)\cr Which of the following countries is not a member of the EU? -- Croatia.\cr How did Mao Zedong expand his power in China? -- The Long March. Economy:\cr Who is this? -- (Picture of Dieter Zetsche, CEO of Mercedes-Benz.)\cr What is the current full Hartz IV standard rate (part of the social welfare) for adults? -- 351 Euro.\cr What was the average per capita gross national product in Germany in 2007? -- About 29,400 Euro.\\ What is a CEO? -- A Chief Executive Officer.\cr What is the meaning of the hexagonal ``organic'' logo? -- Synthetic pesticides are prohibited.\cr Which company does this logo represent? -- Deutsche Bank.\cr Which German company took over the British automobile manufacturers Rolls-Royce? -- BMW.\cr Which internet company took over the media group Time Warner? -- AOL.\cr What is the historic meaning of manufacturies? -- Manufacturies were the precursors of industrial mass production.\cr Culture:\cr Which painter created this painting? -- Andy Warhol.\cr What do these four buildings have in common? -- All four were designed by the same architects.\cr Roman numbers: What is the meaning of CLVI? -- 156.\cr What was the German movie with the most viewers since 1990? -- Der Schuh des Manitu.\cr In which TV series was the US president portrayed by an African American actor for a long time? -- 24.\cr What is the name of the bestselling novel by Daniel Kehlmann? -- Die Vermessung der Welt (Measuring The World).\cr Which city is the setting for the novel \sQuote{Buddenbrooks}? -- Lbeck.\cr In which city is this building located? -- Paris.\cr Which one of the following operas is not by Mozart? -- Aida. Natural sciences:\cr Why does an ice floe not sink in the water? -- Due to the lower density of ice.\cr What is ultrasound not used for? -- Radio.\cr Which sensory cells in the human eye make color vision possible? -- Cones.\cr What is also termed Trisomy 21? -- Down syndrome.\cr Which element is the most common in the Earth's atmosphere? -- Nitrogen.\cr Which kind of tree does this leaf belong to? -- Maple.\cr Which kind of bird is this? -- Blackbird.\cr Where is the stomach located? -- (Indicate location on a map of the body.)\cr What is the sum of interior angles in a triangle? -- 180 degrees. } \references{ Strobl C, Kopf J, Zeileis A (2015). Rasch Trees: A New Method for Detecting Differential Item Functioning in the Rasch Model. \emph{Psychometrika}, \bold{80}(2), 289--316. \doi{10.1007/s11336-013-9388-3} SPIEGEL Online (2009). Studentenpisa -- Alle Fragen, alle Antworten. In German. Accessed 2010-10-26. \url{https://www.spiegel.de/lebenundlernen/uni/studentenpisa-alle-fragen-alle-antworten-a-620101.html} Trepte S, Verbeet M (2010). Allgemeinbildung in Deutschland -- Erkenntnisse aus dem SPIEGEL-Studentenpisa-Test. ISBN 978-3-531-17218-7. VS Verlag, Wiesbaden. } \seealso{\code{\link{raschtree}}} \examples{ ## data data("SPISA", package = "psychotree") ## summary of covariates summary(SPISA[,-1]) ## histogram of raw scores hist(rowSums(SPISA$spisa), breaks = 0:45 + 0.5) \dontrun{ ## See the following vignette for a tree-based DIF analysis vignette("raschtree", package = "psychotree") } } \keyword{datasets} psychotree/man/node_profileplot.Rd0000644000176200001440000000513313150114523017042 0ustar liggesusers\name{node_profileplot} \alias{node_profileplot} \alias{node_raschplot} \title{Panel-Generating Function for Visualizing IRT Tree Models} \description{ Panel-generating function for visualizing the parameters from the nodes in Rasch, rating scale or partial credit tree models. } \usage{ node_profileplot(mobobj, what = c("items", "thresholds", "discriminations"), parg = list(type = NULL, ref = NULL, alias = TRUE), id = TRUE, names = FALSE, abbreviate = TRUE, index = TRUE, ref = TRUE, col = "black", border = col, linecol = "black", refcol = "lightgray", bg = "white", cex = 0.5, pch = 21, xscale = NULL, yscale = NULL, ylines = 2, ...) } \arguments{ \item{mobobj}{an object of class \code{"mob"} based on rasch models fitted by \code{\link[psychotools]{raschmodel}}, rating scale models fitted by \code{\link[psychotools]{rsmodel}} or partial credit models fitted by \code{\link[psychotools]{pcmodel}}.} \item{what}{character, specifying the type of parameters to be plotted.} \item{parg}{list of arguments passed over to internal calls of \code{\link[psychotools]{itempar}}, \code{\link[psychotools]{threshpar}} or \code{\link[psychotools]{discrpar}}.} \item{id}{logical. Should the node ID be displayed?} \item{names}{logical or character. If \code{TRUE}, the names of the items are displayed on the x-axis. If \code{FALSE}, numbers of items are shown. Alternatively a character vector of the same length as the number of items can be supplied.} \item{abbreviate}{logical. Should item names be abbreviated? If numeric this controls the length of the abbreviation.} \item{index}{logical. Should different indexes for different items be used?} \item{ref}{logical. Should a horizontal line for the reference level be drawn?} \item{col, border, pch, cex}{graphical appearance of plotting symbols.} \item{linecol, refcol}{character, specifying the line color to use for the profile lines and reference line, respectively.} \item{bg}{color for background filling.} \item{xscale, yscale}{x and y axis limits.} \item{ylines}{numeric. Number of lines used for y-axis labels.} \item{\dots}{further arguments currently not used.} } \details{ The panel-generating function \code{node_profileplot} is called by the \code{plot} method for \code{"raschtree"} objects and does not have to be called by the user directly. Prior to version 0.13-1, \code{node_profileplot} was called \code{node_raschplot}. } \value{ A panel function which can be supplied to the \code{plot} method for \code{"mob"} objects. } \seealso{\code{\link{raschtree}}} \keyword{hplot} psychotree/man/node_btplot.Rd0000644000176200001440000000355613277210320016020 0ustar liggesusers\name{node_btplot} \alias{node_btplot} \title{Panel-Generating Function for Visualizing Bradley-Terry Tree Models} \description{ Panel-generating function for visualizing the worth parameters from the nodes in Bradley-Terry tree models. } \usage{ node_btplot(mobobj, id = TRUE, worth = TRUE, names = TRUE, abbreviate = TRUE, index = TRUE, ref = TRUE, col = "black", refcol = "lightgray", bg = "white", cex = 0.5, pch = 19, xscale = NULL, yscale = NULL, ylines = 1.5) } \arguments{ \item{mobobj}{an object of class \code{"mob"} based on Bradley-Terry models fitted by \code{\link[psychotools]{btmodel}}.} \item{id}{logical. Should the node ID be displayed?} \item{worth}{logical. Should worth parameters (or their logs) be visualized?} \item{names}{logical. Should the names for the objects be displayed?} \item{abbreviate}{logical or numeric. Should object names be abbreviated? If numeric this controls the length of the abbreviation.} \item{index}{logical. Should different indexes for different stimuli be used?} \item{ref}{logical. Should a horizontal line for the reference level be drawn? Alternatively, \code{ref} can also be numeric or character to employ a reference level different from that stored in the model object.} \item{col, cex, pch}{graphical appearance of plotting symbols.} \item{refcol}{line color for reference line (if \code{ref}).} \item{bg}{color for background filling.} \item{xscale, yscale}{x and y axis limits.} \item{ylines}{numeric. Number of lines used for y-axis labels.} } \details{ The panel-generating function \code{node_btplot} is called by the \code{plot} method for \code{"bttree"} objects and does not have to be called by the user directly. } \value{ A panel function which can be supplied to the \code{plot} method for \code{"mob"} objects. } \seealso{\code{\link{bttree}}} \keyword{hplot} psychotree/man/node_mptplot.Rd0000644000176200001440000000341413150114472016205 0ustar liggesusers\name{node_mptplot} \alias{node_mptplot} \title{Panel-Generating Function for Visualizing MPT Tree Models} \description{ Panel-generating function for visualizing the model parameters from the nodes in MPT tree models. } \usage{ node_mptplot(mobobj, id = TRUE, names = TRUE, abbreviate = TRUE, index = TRUE, ref = TRUE, col = "black", linecol = "lightgray", bg = "white", cex = 0.5, pch = 19, xscale = NULL, yscale = c(0, 1), ylines = 1.5) } \arguments{ \item{mobobj}{an object of class \code{"mob"} based on MPT models fitted by \code{\link[psychotools]{mptmodel}}.} \item{id}{logical. Should the node ID be displayed?} \item{names}{logical or character. Should the names for the parameters be displayed? If character, this sets the names.} \item{abbreviate}{logical or numeric. Should parameter names be abbreviated? If numeric this controls the length of the abbreviation.} \item{index}{logical or character. Should different indexes for different parameters be used? If character, this controls the order of labels given in \code{names}.} \item{ref}{logical. Should a horizontal line for the reference level be drawn?} \item{col, cex, pch}{graphical appearance of plotting symbols.} \item{linecol}{line color for reference line (if \code{ref}).} \item{bg}{color for background filling.} \item{xscale, yscale}{x and y axis limits.} \item{ylines}{numeric. Number of lines used for y-axis labels.} } \details{ The panel-generating function \code{node_mptplot} is called by the \code{plot} method for \code{"mpttree"} objects and does not have to be called by the user directly. } \value{ A panel function which can be supplied to the \code{plot} method for \code{"mob"} objects. } \seealso{\code{\link{mpttree}}} \keyword{hplot} psychotree/man/rstree.Rd0000644000176200001440000001243213614374232015014 0ustar liggesusers\name{rstree} \alias{rstree} \alias{plot.rstree} \alias{print.rstree} \alias{predict.rstree} \alias{itempar.rstree} \alias{threshpar.rstree} \title{Rating Scale Trees} \description{ Recursive partitioning (also known as trees) based on rating scale models. } \usage{ rstree(formula, data, na.action, reltol = 1e-10, deriv = c("sum", "diff"), maxit = 100L, \dots) \method{predict}{rstree}(object, newdata = NULL, type = c("probability", "cumprobability", "mode", "median", "mean", "category-information", "item-information", "test-information", "node"), personpar = 0, \dots) \method{plot}{rstree}(x, type = c("regions", "profile"), terminal_panel = NULL, tp_args = list(...), tnex = 2L, drop_terminal = TRUE, ...) } \arguments{ \item{formula}{A symbolic description of the model to be fit. This should be of type \code{y ~ x1 + x2} where \code{y} should be a matrix with items in the columns and observations in the rows and \code{x1} and \code{x2} are used as partitioning variables. Additionally each item (column) should have the same maximum value (see \code{\link{pctree}} for a way to handle variable maximum values).} \item{data}{a data frame containing the variables in the model.} \item{na.action}{a function which indicates what should happen when the data contain missing values (\code{NA}s).} \item{deriv}{character. If "sum" (the default), the first derivatives of the elementary symmetric functions are calculated with the sum algorithm. Otherwise ("diff") the difference algorithm (faster but numerically unstable) is used.} \item{reltol, maxit}{arguments passed via \code{\link[psychotools]{rsmodel}} to \code{\link[stats]{optim}}.} \item{\dots}{arguments passed to the underlying functions, i.e., to \code{\link[partykit]{mob_control}} for \code{rstree}, and to the underlying \code{predict} and \code{plot} methods, respectively.} \item{object, x}{an object of class \code{"raschtree"}.} \item{newdata}{optional data frame with partitioning variables for which predictions should be computed. By default the learning data set is used.} \item{type}{character specifying the type of predictions or plot. For the \code{predict} method, either just the ID of the terminal \code{"node"} can be predicted or some property of the model at a given person parameter (specified by \code{personpar}).} \item{personpar}{numeric person parameter (of length 1) at which the predictions are evaluated.} \item{terminal_panel, tp_args, tnex, drop_terminal}{arguments passed to \code{\link[partykit]{plot.modelparty}}/\code{\link[partykit]{plot.party}}.} } \details{ Rating scale trees are an application of model-based recursive partitioning (implemented in \code{\link[partykit]{mob}}) to rating scale models (implemented in \code{\link[psychotools]{rsmodel}}). Various methods are provided for \code{"rstree"} objects, most of them inherit their behavior from \code{"mob"} objects (e.g., \code{print}, \code{summary}, etc.). For the rating scale models in the nodes of a tree, \code{coef} extracts all item parameters. The \code{plot} method employs the \code{\link{node_regionplot}} panel-generating function by default. Various methods are provided for \code{"rstree"} objects, most of them inherit their behavior from \code{"modelparty"} objects (e.g., \code{print}, \code{summary}, etc.). For the RSMs in the nodes of a tree, \code{coef} extracts all item and threshold parameters except those restricted to be zero. \code{itempar} and \code{threshpar} extract all item and threshold parameters (including the restricted ones). The \code{plot} method by default employs the \code{\link{node_regionplot}} panel-generating function and the \code{\link{node_profileplot}} panel-generating function is provided as an alternative. } \references{ Komboz B, Zeileis A, Strobl C (2018). Tree-Based Global Model Tests for Polytomous Rasch Models. \emph{Educational and Psychological Measurement}, \bold{78}(1), 128--166. \doi{10.1177/0013164416664394} } \value{ An object of S3 class \code{"rstree"} inheriting from class \code{"modelparty"}. } \seealso{\code{\link[partykit]{mob}}, \code{\link[psychotools]{rsmodel}}, \code{\link{pctree}}, \code{\link{raschtree}}} \examples{ ## IGNORE_RDIFF_BEGIN o <- options(digits = 4) ## verbal aggression data from package psychotools data("VerbalAggression", package = "psychotools") ## responses to the first other-to-blame situation (bus) VerbalAggression$s1 <- VerbalAggression$resp[, 1:6] ## exclude subjects who only scored in the highest or the lowest categories VerbalAggression <- subset(VerbalAggression, rowSums(s1) > 0 & rowSums(s1) < 12) ## fit rating scale tree model for the first other-to-blame situation rst <- rstree(s1 ~ anger + gender, data = VerbalAggression) ## print tree (with and without parameters) print(rst) print(rst, FUN = function(x) " *") ## show summary for terminal panel nodes summary(rst) ## visualization plot(rst, type = "regions") plot(rst, type = "profile") ## extract item and threshold parameters coef(rst) itempar(rst) threshpar(rst) ## inspect parameter stability tests in all splitting nodes if(require("strucchange")) { sctest(rst, node = 1) sctest(rst, node = 2) } options(digits = o$digits) ## IGNORE_RDIFF_END } \keyword{tree} psychotree/man/pctree.Rd0000644000176200001440000001212413614374232014770 0ustar liggesusers\name{pctree} \alias{pctree} \alias{plot.pctree} \alias{print.pctree} \alias{predict.pctree} \alias{itempar.pctree} \alias{threshpar.pctree} \title{Partial Credit Trees} \description{ Recursive partitioning (also known as trees) based on partial credit models. } \usage{ pctree(formula, data, na.action, nullcats = c("keep", "downcode", "ignore"), reltol = 1e-10, deriv = c("sum", "diff"), maxit = 100L, \dots) \method{predict}{pctree}(object, newdata = NULL, type = c("probability", "cumprobability", "mode", "median", "mean", "category-information", "item-information", "test-information", "node"), personpar = 0, \dots) \method{plot}{pctree}(x, type = c("regions", "profile"), terminal_panel = NULL, tp_args = list(...), tnex = 2L, drop_terminal = TRUE, ...) } \arguments{ \item{formula}{A symbolic description of the model to be fit. This should be of type \code{y ~ x1 + x2} where \code{y} should be a matrix with items in the columns and observations in the rows and \code{x1} and \code{x2} are used as partitioning variables.} \item{data}{a data frame containing the variables in the model.} \item{na.action}{a function which indicates what should happen when the data contain missing values (\code{NA}s).} \item{nullcats}{character. How null categories should be treated. See \code{\link[psychotools]{pcmodel}} for details.} \item{deriv}{character. If "sum" (the default), the first derivatives of the elementary symmetric functions are calculated with the sum algorithm. Otherwise ("diff") the difference algorithm (faster but numerically unstable) is used.} \item{reltol, maxit}{arguments passed via \code{\link[psychotools]{pcmodel}} to \code{\link[stats]{optim}}.} \item{\dots}{arguments passed to the underlying functions, i.e., to \code{\link[partykit]{mob_control}} for \code{pctree}, and to the underlying \code{predict} and \code{plot} methods, respectively.} \item{object, x}{an object of class \code{"raschtree"}.} \item{newdata}{optional data frame with partitioning variables for which predictions should be computed. By default the learning data set is used.} \item{type}{character specifying the type of predictions or plot. For the \code{predict} method, either just the ID of the terminal \code{"node"} can be predicted or some property of the model at a given person parameter (specified by \code{personpar}).} \item{personpar}{numeric person parameter (of length 1) at which the predictions are evaluated.} \item{terminal_panel, tp_args, tnex, drop_terminal}{arguments passed to \code{\link[partykit]{plot.modelparty}}/\code{\link[partykit]{plot.party}}.} } \details{ Partial credit trees are an application of model-based recursive partitioning (implemented in \code{\link[partykit]{mob}}) to partial credit models (implemented in \code{\link[psychotools]{pcmodel}}). Various methods are provided for \code{"pctree"} objects, most of them inherit their behavior from \code{"modelparty"} objects (e.g., \code{print}, \code{summary}, etc.). For the PCMs in the nodes of a tree, \code{coef} extracts all item and threshold parameters except those restricted to be zero. \code{itempar} and \code{threshpar} extract all item and threshold parameters (including the restricted ones). The \code{plot} method by default employs the \code{\link{node_regionplot}} panel-generating function and the \code{\link{node_profileplot}} panel-generating function is provided as an alternative. } \references{ Komboz B, Zeileis A, Strobl C (2018). Tree-Based Global Model Tests for Polytomous Rasch Models. \emph{Educational and Psychological Measurement}, \bold{78}(1), 128--166. \doi{10.1177/0013164416664394} } \value{ An object of S3 class \code{"pctree"} inheriting from class \code{"modelparty"}. } \seealso{\code{\link[partykit]{mob}}, \code{\link[psychotools]{pcmodel}}, \code{\link{rstree}}, \code{\link{raschtree}}} \examples{ o <- options(digits = 4) ## verbal aggression data from package psychotools data("VerbalAggression", package = "psychotools") ## use response to the second other-to-blame situation (train) VerbalAggression$s2 <- VerbalAggression$resp[, 7:12] ## exclude subjects who only scored in the highest or the lowest categories VerbalAggression <- subset(VerbalAggression, rowSums(s2) > 0 & rowSums(s2) < 12) ## fit partial credit tree model pct <- pctree(s2 ~ anger + gender, data = VerbalAggression) ## print tree (with and without parameters) print(pct) print(pct, FUN = function(x) " *") ## show summary for terminal panel nodes summary(pct) ## visualization plot(pct, type = "regions") plot(pct, type = "profile") ## extract item and threshold parameters coef(pct) itempar(pct) threshpar(pct) ## inspect parameter stability tests in the splitting node if(require("strucchange")) sctest(pct, node = 1) options(digits = o$digits) \donttest{ ## partial credit tree on artificial data from Komboz et al. (2018) data("DIFSimPC", package = "psychotree") pct2 <- pctree(resp ~ gender + age + motivation, data = DIFSimPC) plot(pct2, ylim = c(-4.5, 4.5), names = paste("I", 1:8)) } } \keyword{tree} psychotree/man/mpttree.Rd0000644000176200001440000000602713614374232015173 0ustar liggesusers\name{mpttree} \alias{mpttree} \alias{coef.mpttree} \alias{plot.mpttree} \alias{print.mpttree} \alias{predict.mpttree} \encoding{latin1} \title{MPT Trees} \description{ Recursive partitioning (also known as trees) based on multinomial processing tree (MPT) models. } \usage{ mpttree(formula, data, na.action, cluster, spec, treeid = NULL, optimargs = list(control = list(reltol = .Machine$double.eps^(1/1.2), maxit = 1000)), \dots) } \arguments{ \item{formula}{a symbolic description of the model to be fit. This should be of type \code{y ~ x1 + x2} where \code{y} should be a matrix of response frequencies and \code{x1} and \code{x2} are used as partitioning variables.} \item{data}{an optional data frame containing the variables in the model.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s, defaulting to \code{\link[stats]{na.pass}}.} \item{cluster}{optional vector (typically numeric or factor) with a cluster ID to be employed for clustered covariances in the parameter stability tests.} \item{spec, treeid, optimargs}{arguments for the MPT model passed on to \code{\link[psychotools]{mptmodel}}.} \item{\dots}{arguments passed to \code{\link[partykit]{mob_control}}.} } \details{ MPT trees (Wickelmaier & Zeileis, 2018) are an application of model-based recursive partitioning (implemented in \code{\link[partykit]{mob}}) to MPT models (implemented in \code{\link[psychotools]{mptmodel}}). Various methods are provided for \code{"mpttree"} objects, most of them inherit their behavior from \code{"mob"} objects (e.g., \code{print}, \code{summary}, etc.). The \code{plot} method employs the \code{\link{node_mptplot}} panel-generating function. } \value{ An object of S3 class \code{"mpttree"} inheriting from class \code{"modelparty"}. } \references{ Wickelmaier F, Zeileis A (2018). Using Recursive Partitioning to Account for Parameter Heterogeneity in Multinomial Processing Tree Models. \emph{Behavior Research Methods}, \bold{50}(3), 1217--1233. \doi{10.3758/s13428-017-0937-z} } \seealso{\code{\link[partykit]{mob}}, \code{\link[psychotools]{mptmodel}}.} \examples{ o <- options(digits = 4) ## Source Monitoring data data("SourceMonitoring", package = "psychotools") ## MPT tree sm_tree <- mpttree(y ~ sources + gender + age, data = SourceMonitoring, spec = mptspec("SourceMon", .restr = list(d1 = d, d2 = d))) plot(sm_tree, index = c("D1", "D2", "d", "b", "g")) ## extract parameter estimates coef(sm_tree) ## parameter instability tests in root node if(require("strucchange")) sctest(sm_tree, node = 1) ## storage and retrieval deficits in psychiatric patients data("MemoryDeficits", package = "psychotools") MemoryDeficits$trial <- ordered(MemoryDeficits$trial) ## MPT tree sr_tree <- mpttree(cbind(E1, E2, E3, E4) ~ trial + group, data = MemoryDeficits, cluster = ID, spec = mptspec("SR2"), alpha = 0.1) ## extract parameter estimates coef(sr_tree) options(digits = o$digits) } \keyword{tree} psychotree/man/DIFSim.Rd0000644000176200001440000000340413614374232014562 0ustar liggesusers\name{DIFSim} \alias{DIFSim} \alias{DIFSimPC} \title{Artificial Data with Differential Item Functioning} \description{ Artificial data simulated from a Rasch model and a partial credit model, respectively, where the items exhibit differential item functioning (DIF). } \usage{ data(DIFSim) data(DIFSimPC) } \format{ Two data frames containing 200 and 500 observations, respectively, on 4 variables. \describe{ \item{resp}{an \code{\link[psychotools]{itemresp}} matrix with binary or polytomous results for 20 or 8 items, respectively.} \item{age}{age in years.} \item{gender}{factor indicating gender.} \item{motivation}{ordered factor indicating motivation level.} } } \details{ The data are employed for illustrations in Strobl et al. (2015) and Komboz et al. (2018). See the manual pages for \code{\link{raschtree}} and \code{\link{pctree}} for fitting the tree models.. } \references{ Komboz B, Zeileis A, Strobl C (2018). Tree-Based Global Model Tests for Polytomous Rasch Models. \emph{Educational and Psychological Measurement}, \bold{78}(1), 128--166. \doi{10.1177/0013164416664394} Strobl C, Kopf J, Zeileis A (2015). Rasch Trees: A New Method for Detecting Differential Item Functioning in the Rasch Model. \emph{Psychometrika}, \bold{80}(2), 289--316. \doi{10.1007/s11336-013-9388-3} } \seealso{\code{\link{raschtree}}, \code{\link{pctree}}} \examples{ ## data data("DIFSim", package = "psychotree") data("DIFSimPC", package = "psychotree") ## summary of covariates summary(DIFSim[, -1]) summary(DIFSimPC[, -1]) ## empirical frequencies of responses plot(DIFSim$resp) plot(DIFSimPC$resp) ## histogram of raw scores hist(rowSums(DIFSim$resp), breaks = 0:20 - 0.5) hist(rowSums(DIFSimPC$resp), breaks = 0:17 - 0.5) } \keyword{datasets} psychotree/man/raschtree.Rd0000644000176200001440000001123513614374232015470 0ustar liggesusers\name{raschtree} \alias{raschtree} \alias{print.raschtree} \alias{plot.raschtree} \alias{predict.raschtree} \alias{itempar.raschtree} \title{Rasch Trees} \description{ Recursive partitioning (also known as trees) based on Rasch models. } \usage{ raschtree(formula, data, na.action, reltol = 1e-10, deriv = c("sum", "diff", "numeric"), maxit = 100L, \dots) \method{predict}{raschtree}(object, newdata = NULL, type = c("probability", "cumprobability", "mode", "median", "mean", "category-information", "item-information", "test-information", "node"), personpar = 0, \dots) \method{plot}{raschtree}(x, type = c("profile", "regions"), terminal_panel = NULL, tp_args = list(...), tnex = 2L, drop_terminal = TRUE, ...) } \arguments{ \item{formula}{A symbolic description of the model to be fit. This should be of type \code{y ~ x1 + x2} where \code{y} should be a binary 0/1 item response matrix and \code{x1} and \code{x2} are used as partitioning variables.} \item{data}{a data frame containing the variables in the model.} \item{na.action}{a function which indicates what should happen when the data contain missing values (\code{NA}s).} \item{deriv}{character. Which type of derivatives should be used for computing gradient and Hessian matrix? Analytical with sum algorithm (\code{"sum"}), analytical with difference algorithm (\code{"diff"}, faster but numerically unstable), or numerical. Passed to \code{\link[psychotools]{raschmodel}}.} \item{reltol, maxit}{arguments passed via \code{\link[psychotools]{raschmodel}} to \code{\link[stats]{optim}}.} \item{\dots}{arguments passed to the underlying functions, i.e., to \code{\link[partykit]{mob_control}} for \code{raschtree}, and to the underlying \code{predict} and \code{plot} methods, respectively.} \item{object, x}{an object of class \code{"raschtree"}.} \item{newdata}{optional data frame with partitioning variables for which predictions should be computed. By default the learning data set is used.} \item{type}{character specifying the type of predictions or plot. For the \code{predict} method, either just the ID of the terminal \code{"node"} can be predicted or some property of the model at a given person parameter (specified by \code{personpar}).} \item{personpar}{numeric person parameter (of length 1) at which the predictions are evaluated.} \item{terminal_panel, tp_args, tnex, drop_terminal}{arguments passed to \code{\link[partykit]{plot.modelparty}}/\code{\link[partykit]{plot.party}}.} } \details{ Rasch trees are an application of model-based recursive partitioning (implemented in \code{\link[partykit]{mob}}) to Rasch models (implemented in \code{\link[psychotools]{raschmodel}}). Various methods are provided for \code{"raschtree"} objects, most of them inherit their behavior from \code{"modelparty"} objects (e.g., \code{print}, \code{summary}, etc.). For the Rasch models in the nodes of a tree, \code{coef} extracts all item parameters except the first one which is always restricted to be zero. \code{itempar} extracts all item parameters (including the first one) and by default restricts their sum to be zero (but other restrictions can be used as well). The \code{plot} method by default employs the \code{\link{node_profileplot}} panel-generating function and the \code{\link{node_regionplot}} panel-generating function is provided as an alternative. Rasch tree models are introduced in Strobl et al. (2015), whose analysis for the \code{\link{SPISA}} data is replicated in \code{vignette("raschtree", package = "psychotree")}. Their illustration employing artificial data is replicated below. } \references{ Strobl C, Kopf J, Zeileis A (2015). Rasch Trees: A New Method for Detecting Differential Item Functioning in the Rasch Model. \emph{Psychometrika}, \bold{80}(2), 289--316. \doi{10.1007/s11336-013-9388-3} } \value{ An object of S3 class \code{"raschtree"} inheriting from class \code{"modelparty"}. } \seealso{\code{\link[partykit]{mob}}, \code{\link[psychotools]{raschmodel}}, \code{\link{rstree}}, \code{\link{pctree}}} \examples{ o <- options(digits = 4) ## artificial data data("DIFSim", package = "psychotree") ## fit Rasch tree model rt <- raschtree(resp ~ age + gender + motivation, data = DIFSim) plot(rt) ## extract item parameters itempar(rt) ## inspect parameter stability tests in all splitting nodes if(require("strucchange")) { sctest(rt, node = 1) sctest(rt, node = 2) } ## highlight items 3 and 14 with DIF ix <- rep(1, 20) ix[c(3, 14)] <- 2 plot(rt, ylines = 2.5, cex = c(0.4, 0.8)[ix], pch = c(19, 19)[ix], col = gray(c(0.5, 0))[ix]) options(digits = o$digits) } \keyword{tree} psychotree/man/CEMSChoice.Rd0000644000176200001440000000707014051746133015353 0ustar liggesusers\name{CEMSChoice} \alias{CEMSChoice} \encoding{latin1} \title{CEMS University Choice Data} \description{ Preferences of 303 students from WU Wien for different CEMS universities. } \usage{data("CEMSChoice")} \format{ A data frame containing 303 observations on 10 variables. \describe{ \item{preference}{Paired comparison of class \code{\link{paircomp}}. Preferences for all 15 paired comparisons from 6 objects: London, Paris, Milano, St. Gallen, Barcelona, Stockholm.} \item{study}{Factor coding main discipline of study: commerce, or other (economics, business administration, business education).} \item{english}{Factor coding knowledge of English (good, poor).} \item{french}{Factor coding knowledge of French (good, poor).} \item{spanish}{Factor coding knowledge of Spanish (good, poor).} \item{italian}{Factor coding knowledge of Italian (good, poor).} \item{work}{Factor. Was the student working full-time while studying?} \item{gender}{Factor coding gender.} \item{intdegree}{Factor. Does the student intend to take an international degree?} \item{preference1998}{Paired comparison of class \code{\link{paircomp}}. This is like \code{preference} but the comparisons between Barcelona an Stockholm are (erroneously) reversed, see below.} } } \details{ Students at Wirtschaftsuniversitt Wien (\url{https://www.wu.ac.at/}) can study abroad visiting one of currently 17 CEMS universities (Community of European Management Schools and International Companies). Dittrich et al. (1998) conduct and analyze a survey of 303 students to examine the student's preferences for 6 universities: London School of Economics, HEC Paris, Universit Commerciale Luigi Bocconi (Milano), Universitt St. Gallen, ESADE (Barcelona), Handelshgskolan i Stockholm. To identify reasons for the preferences, several subject covariates (including foreign language competence, gender, etc.) have been assessed. Furthermore, several object covariates are attached to \code{preference} (and \code{preference1998}): the universities' field of \code{specialization} (economics, management science, finance) and location (Latin country, or other). The correct data are available in the online complements to Dittrich et al. (1998). However, the accompanying analysis was based on an erroneous version of the data in which the choices for the last comparison pair (Barcelona : Stockholm) were accidentally reversed. See the corrigendum in Dittrich et al. (2001) for further details. The variable \code{preference} provides the correct data and can thus be used to replicate the analysis from the corrigendum (Dittrich et al. 2001). For convenience, the erroneous version is provided in \code{preference1998} which can therefore be used to replicate the (incorrect) original analysis (Dittrich et al. 1998). } \source{ The Royal Statistical Society Datasets Website. } \references{ Dittrich R, Hatzinger R, Katzenbeisser W (1998). Modelling the Effect of Subject-Specific Covariates in Paired Comparison Studies with an Application to University Rankings, \emph{Journal of the Royal Statistical Society C}, \bold{47}, 511--525. Dittrich R, Hatzinger R, Katzenbeisser W (2001). Corrigendum: Modelling the Effect of Subject-Specific Covariates in Paired Comparison Studies with an Application to University Rankings, \emph{Journal of the Royal Statistical Society C}, \bold{50}, 247--249. } \seealso{\code{\link{paircomp}}} \examples{ data("CEMSChoice", package = "psychotree") summary(CEMSChoice$preference) covariates(CEMSChoice$preference) } \keyword{datasets} psychotree/man/bttree.Rd0000644000176200001440000000774013614374232015003 0ustar liggesusers\name{bttree} \alias{bttree} \alias{plot.bttree} \alias{print.bttree} \alias{predict.bttree} \alias{itempar.bttree} \title{Bradley-Terry Trees} \description{ Recursive partitioning (also known as trees) based on Bradley-Terry models. } \usage{ bttree(formula, data, na.action, cluster, type = "loglin", ref = NULL, undecided = NULL, position = NULL, \dots) \method{predict}{bttree}(object, newdata = NULL, type = c("worth", "rank", "best", "node"), \dots) } \arguments{ \item{formula}{A symbolic description of the model to be fit. This should be of type \code{y ~ x1 + x2} where \code{y} should be an object of class \code{\link[psychotools]{paircomp}} and \code{x1} and \code{x2} are used as partitioning variables.} \item{data}{an optional data frame containing the variables in the model.} \item{na.action}{A function which indicates what should happen when the data contain \code{NA}s, defaulting to \code{\link[stats]{na.pass}}.} \item{cluster}{optional vector (typically numeric or factor) with a cluster ID to be employed for clustered covariances in the parameter stability tests.} \item{type}{character indicating the type of auxiliary model in \code{bttree} and the type of predictions in the \code{predict} method, respectively. For the auxiliary model see \code{\link[psychotools]{btmodel}}. For the \code{predict} method, four options are available: the fitted \code{"worth"} parameter for each alternative, the corresponding \code{"rank"}, the \code{"best"} alternative or the predicted \code{"node"} number.} \item{ref, undecided, position}{arguments for the Bradley-Terry model passed on to \code{\link[psychotools]{btmodel}}.} \item{\dots}{arguments passed to \code{\link[partykit]{mob_control}}.} \item{object}{fitted model object of class \code{"bttree"}.} \item{newdata}{optionally, a data frame in which to look for variables with which to predict. If omitted, the original observations are used.} } \details{ Bradley-Terry trees are an application of model-based recursive partitioning (implemented in \code{\link[partykit]{mob}}) to Bradley-Terry models for paired comparison data (implemented in \code{\link[psychotools]{btmodel}}). Details about the underlying theory and further explanations of the illustrations in the example section can be found in Strobl, Wickelmaier, Zeileis (2011). Various methods are provided for \code{"bttree"} objects, most of them inherit their behavior from \code{"mob"} objects (e.g., \code{print}, \code{summary}, etc.). \code{itempar} behaves analogously to \code{coef} and extracts the worth/item parameters from the BT models in the nodes of the tree. The \code{plot} method employs the \code{\link{node_btplot}} panel-generating function. } \value{ An object of S3 class \code{"bttree"} inheriting from class \code{"modelparty"}. } \references{ Strobl C, Wickelmaier F, Zeileis A (2011). Accounting for Individual Differences in Bradley-Terry Models by Means of Recursive Partitioning. \emph{Journal of Educational and Behavioral Statistics}, \bold{36}(2), 135--153. \doi{10.3102/1076998609359791} } \seealso{\code{\link[partykit]{mob}}, \code{\link[psychotools]{btmodel}}} \examples{ o <- options(digits = 4) ## Germany's Next Topmodel 2007 data data("Topmodel2007", package = "psychotree") ## BT tree tm_tree <- bttree(preference ~ ., data = Topmodel2007, minsize = 5, ref = "Barbara") plot(tm_tree, abbreviate = 1, yscale = c(0, 0.5)) ## parameter instability tests in root node if(require("strucchange")) sctest(tm_tree, node = 1) ## worth/item parameters in terminal nodes itempar(tm_tree) ## CEMS university choice data data("CEMSChoice", package = "psychotree") summary(CEMSChoice$preference) ## BT tree cems_tree <- bttree(preference ~ french + spanish + italian + study + work + gender + intdegree, data = CEMSChoice, minsize = 5, ref = "London") plot(cems_tree, abbreviate = 1, yscale = c(0, 0.5)) itempar(cems_tree) options(digits = o$digits) } \keyword{tree} psychotree/DESCRIPTION0000644000176200001440000000313214051776052014153 0ustar liggesusersPackage: psychotree Title: Recursive Partitioning Based on Psychometric Models Version: 0.15-4 Date: 2021-05-21 Authors@R: c(person(given = "Achim", family = "Zeileis", role = c("aut", "cre"), email = "Achim.Zeileis@R-project.org", comment = c(ORCID = "0000-0003-0918-3766")), person(given = "Carolin", family = "Strobl", role = "aut", email = "Carolin.Strobl@psychologie.uzh.ch"), person(given = "Florian", family = "Wickelmaier", role = "aut"), person(given = "Basil", family = "Komboz", role = "aut"), person(given = "Julia", family = "Kopf", role = "aut"), person(given = "Lennart", family = "Schneider", role = "ctb", email = "Lennart.Sch@web.de", comment = c(ORCID = "0000-0003-4152-5308"))) Depends: R (>= 4.0.0), partykit (>= 0.8-4), psychotools (>= 0.4-0) Suggests: stablelearner (>= 0.1-3), strucchange Imports: graphics, grDevices, grid, stats, Formula Description: Recursive partitioning based on psychometric models, employing the general MOB algorithm (from package partykit) to obtain Bradley-Terry trees, Rasch trees, rating scale and partial credit trees, and MPT trees. License: GPL-2 | GPL-3 NeedsCompilation: no Packaged: 2021-05-21 17:53:10 UTC; zeileis Author: Achim Zeileis [aut, cre] (), Carolin Strobl [aut], Florian Wickelmaier [aut], Basil Komboz [aut], Julia Kopf [aut], Lennart Schneider [ctb] () Maintainer: Achim Zeileis Repository: CRAN Date/Publication: 2021-05-21 18:30:02 UTC psychotree/build/0000755000176200001440000000000014051771605013544 5ustar liggesuserspsychotree/build/vignette.rds0000644000176200001440000000052714051771605016107 0ustar liggesusersuQ]K0͹@B~~E L|Hr2/w޴"ޓs}_FQGSㄶɚ4&]кBn"&S f:0[;ضUZR#Kelg>]V%s,E eI}j#d٘.xFc `M ƙ5y …g#Q8gʀs.{Ѻ7:4oCw]anFt+=kda_Uw^.}t/lC. ۰,{fpsychotree/build/partial.rdb0000644000176200001440000012275114051771516015702 0ustar liggesusersi{I.B$)JBK($ @ C ` 8IO9HwDF܈w{owY{LO׬=37S3cq4ጬtG 5;ǎfd2]]$d2݄}?%?]5.3M-*2@ 5!V-ۤ̈́]+3r_iy׬Uk%iyϷ:#OWԿoy@6<^_GsmCɪUνZYLOOJò+7VMclel񱑺Y^w|4GFm$4MqҢC׋r{ivu`9 ->=[Hucn}jWmh-Z;9mmнJYa[F>'i '!&Y4J7 F$ Ct7EiO4#"ēoMj-fO `,=VWM׬oVlV-T9RsBoE+Iȓ雏. iDRn]:<:"z$~1+ΞUm؆oVتT ΪNŴQO9_dԋ<%|v^0^Eio؇u^,n2J '] ,}V , _MR"ۿ\1kՉd!VQIa@)Ofb#ģ-Tdsak%/IhR'ؼ8-L˳[ڃlD5 <`y뼍! 킞eUwSb w9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spsychotree/tests/Examples/0000755000176200001440000000000013614374232015364 5ustar liggesuserspsychotree/tests/Examples/psychotree-Ex.Rout.save0000644000176200001440000006306313614374232021743 0ustar liggesusers R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "psychotree" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('psychotree') Loading required package: partykit Loading required package: grid Loading required package: libcoin Loading required package: mvtnorm Loading required package: psychotools > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("CEMSChoice") > ### * CEMSChoice > > flush(stderr()); flush(stdout()) > > ### Name: CEMSChoice > ### Title: CEMS University Choice Data > ### Aliases: CEMSChoice > ### Keywords: datasets > > ### ** Examples > > data("CEMSChoice", package = "psychotree") > summary(CEMSChoice$preference) > = < NA's London : Paris 186 26 91 0 London : Milano 221 26 56 0 Paris : Milano 121 32 59 91 London : StGallen 208 22 73 0 Paris : StGallen 165 19 119 0 Milano : StGallen 135 28 140 0 London : Barcelona 217 19 67 0 Paris : Barcelona 157 37 109 0 Milano : Barcelona 104 67 132 0 StGallen : Barcelona 144 25 134 0 London : Stockholm 250 19 34 0 Paris : Stockholm 203 30 70 0 Milano : Stockholm 157 46 100 0 StGallen : Stockholm 155 50 98 0 Barcelona : Stockholm 172 41 90 0 > covariates(CEMSChoice$preference) specialization location London economics other Paris management science latin Milano economics latin StGallen finance other Barcelona management science latin Stockholm finance other > > > > cleanEx() > nameEx("DIFSim") > ### * DIFSim > > flush(stderr()); flush(stdout()) > > ### Name: DIFSim > ### Title: Artificial Data with Differential Item Functioning > ### Aliases: DIFSim DIFSimPC > ### Keywords: datasets > > ### ** Examples > > ## data > data("DIFSim", package = "psychotree") > data("DIFSimPC", package = "psychotree") > > ## summary of covariates > summary(DIFSim[, -1]) age gender motivation Min. :16.00 male :109 1:23 1st Qu.:31.00 female: 91 2:41 Median :45.00 3:45 Mean :45.84 4:35 3rd Qu.:60.00 5:41 Max. :74.00 6:15 > summary(DIFSimPC[, -1]) age gender motivation Min. :20.00 male :239 1:125 1st Qu.:35.00 female:261 2: 88 Median :49.00 3: 96 Mean :49.69 4: 90 3rd Qu.:64.00 5:101 Max. :80.00 > > ## empirical frequencies of responses > plot(DIFSim$resp) > plot(DIFSimPC$resp) > > ## histogram of raw scores > hist(rowSums(DIFSim$resp), breaks = 0:20 - 0.5) > hist(rowSums(DIFSimPC$resp), breaks = 0:17 - 0.5) > > > > cleanEx() > nameEx("EuropeanValuesStudy") > ### * EuropeanValuesStudy > > flush(stderr()); flush(stdout()) > > ### Name: EuropeanValuesStudy > ### Title: European Values Study > ### Aliases: EuropeanValuesStudy > ### Keywords: datasets > > ### ** Examples > > ## data > data("EuropeanValuesStudy", package = "psychotree") > summary(EuropeanValuesStudy$paircomp) > < NA's order : decisions 2136 1293 155 order : prices 2178 949 457 decisions : prices 1694 1335 555 order : freedom 2358 761 465 decisions : freedom 1732 860 992 prices : freedom 1558 1066 960 > > ## Not run: > ##D ## Bradley-Terry tree resulting in similar results compared to > ##D ## the (different) tree approach of Lee and Lee (2010) > ##D evs <- na.omit(EuropeanValuesStudy) > ##D bt <- bttree(paircomp ~ gender + eduage + birthyear + marital + employment + income + country2, > ##D data = evs, alpha = 0.01) > ##D plot(bt, abbreviate = 2) > ## End(Not run) > > > > cleanEx() > nameEx("SPISA") > ### * SPISA > > flush(stderr()); flush(stdout()) > > ### Name: SPISA > ### Title: SPIEGEL Studentenpisa Data (Subsample) > ### Aliases: SPISA > ### Keywords: datasets > > ### ** Examples > > ## data > data("SPISA", package = "psychotree") > > ## summary of covariates > summary(SPISA[,-1]) gender age semester elite spon female:417 Min. :18.0 2 :173 no :836 never :303 male :658 1st Qu.:21.0 4 :123 yes:239 <1/month :127 Median :23.0 6 :116 1-3/month:107 Mean :23.1 1 :105 1/week : 79 3rd Qu.:25.0 5 : 99 2-3/week : 73 Max. :40.0 3 : 98 4-5/week : 60 (Other):361 daily :326 > > ## histogram of raw scores > hist(rowSums(SPISA$spisa), breaks = 0:45 + 0.5) > > ## Not run: > ##D ## See the following vignette for a tree-based DIF analysis > ##D vignette("raschtree", package = "psychotree") > ## End(Not run) > > > > cleanEx() > nameEx("Topmodel2007") > ### * Topmodel2007 > > flush(stderr()); flush(stdout()) > > ### Name: Topmodel2007 > ### Title: Attractiveness of Germany's Next Topmodels 2007 > ### Aliases: Topmodel2007 > ### Keywords: datasets > > ### ** Examples > > data("Topmodel2007", package = "psychotree") > summary(Topmodel2007$preference) > < Barbara : Anni 121 71 Barbara : Hana 98 94 Anni : Hana 75 117 Barbara : Fiona 101 91 Anni : Fiona 81 111 Hana : Fiona 113 79 Barbara : Mandy 130 62 Anni : Mandy 114 78 Hana : Mandy 130 62 Fiona : Mandy 131 61 Barbara : Anja 123 69 Anni : Anja 112 80 Hana : Anja 130 62 Fiona : Anja 119 73 Mandy : Anja 92 100 > xtabs(~ gender + I(age < 30), data = Topmodel2007) I(age < 30) gender FALSE TRUE male 48 48 female 48 48 > > > > cleanEx() > nameEx("bttree") > ### * bttree > > flush(stderr()); flush(stdout()) > > ### Name: bttree > ### Title: Bradley-Terry Trees > ### Aliases: bttree plot.bttree print.bttree predict.bttree itempar.bttree > ### Keywords: tree > > ### ** Examples > > o <- options(digits = 4) > > ## Germany's Next Topmodel 2007 data > data("Topmodel2007", package = "psychotree") > > ## BT tree > tm_tree <- bttree(preference ~ ., data = Topmodel2007, minsize = 5, ref = "Barbara") > plot(tm_tree, abbreviate = 1, yscale = c(0, 0.5)) > > ## parameter instability tests in root node > if(require("strucchange")) sctest(tm_tree, node = 1) Loading required package: strucchange Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich gender age q1 q2 q3 statistic 17.08798 3.236e+01 12.6320 19.83922 6.7586 p.value 0.02149 7.915e-04 0.1283 0.00668 0.7452 > > ## worth/item parameters in terminal nodes > itempar(tm_tree) Barbara Anni Hana Fiona Mandy Anja 3 0.1889 0.16993 0.3851 0.1142 0.09232 0.04958 5 0.1746 0.12305 0.2625 0.2254 0.10188 0.11259 6 0.2659 0.21278 0.1609 0.1945 0.06275 0.10310 7 0.2585 0.05573 0.1531 0.1605 0.16427 0.20792 > > ## CEMS university choice data > data("CEMSChoice", package = "psychotree") > summary(CEMSChoice$preference) > = < NA's London : Paris 186 26 91 0 London : Milano 221 26 56 0 Paris : Milano 121 32 59 91 London : StGallen 208 22 73 0 Paris : StGallen 165 19 119 0 Milano : StGallen 135 28 140 0 London : Barcelona 217 19 67 0 Paris : Barcelona 157 37 109 0 Milano : Barcelona 104 67 132 0 StGallen : Barcelona 144 25 134 0 London : Stockholm 250 19 34 0 Paris : Stockholm 203 30 70 0 Milano : Stockholm 157 46 100 0 StGallen : Stockholm 155 50 98 0 Barcelona : Stockholm 172 41 90 0 > > ## BT tree > cems_tree <- bttree(preference ~ french + spanish + italian + study + work + gender + intdegree, + data = CEMSChoice, minsize = 5, ref = "London") > plot(cems_tree, abbreviate = 1, yscale = c(0, 0.5)) > itempar(cems_tree) London Paris Milano StGallen Barcelona Stockholm 3 0.2083 0.12682 0.15936 0.06905 0.42506 0.01135 4 0.4315 0.08630 0.34017 0.05205 0.06060 0.02939 7 0.3325 0.42215 0.05478 0.06144 0.09252 0.03656 8 0.3989 0.22586 0.08578 0.13480 0.09108 0.06360 9 0.4104 0.09624 0.07697 0.15767 0.16424 0.09451 > > options(digits = o$digits) > > > > cleanEx() detaching ‘package:strucchange’, ‘package:sandwich’, ‘package:zoo’ > nameEx("mpttree") > ### * mpttree > > flush(stderr()); flush(stdout()) > > ### Name: mpttree > ### Title: MPT Trees > ### Aliases: mpttree coef.mpttree plot.mpttree print.mpttree > ### predict.mpttree > ### Keywords: tree > > ### ** Examples > > o <- options(digits = 4) > > ## Source Monitoring data > data("SourceMonitoring", package = "psychotools") > > ## MPT tree > sm_tree <- mpttree(y ~ sources + gender + age, data = SourceMonitoring, + spec = mptspec("SourceMon", .restr = list(d1 = d, d2 = d))) > plot(sm_tree, index = c("D1", "D2", "d", "b", "g")) > > ## extract parameter estimates > coef(sm_tree) D1 d g b D2 3 0.6245 0.4417 0.6285 0.1178 0.7420 4 0.5373 0.2643 0.5144 0.2045 0.7179 5 0.6349 0.4456 0.4696 0.1948 0.6120 > > ## parameter instability tests in root node > if(require("strucchange")) sctest(sm_tree, node = 1) Loading required package: strucchange Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich sources gender age statistic 2.848e+01 9.0034 16.9298 p.value 8.805e-05 0.2925 0.2489 > > ## storage and retrieval deficits in psychiatric patients > data("MemoryDeficits", package = "psychotools") > MemoryDeficits$trial <- ordered(MemoryDeficits$trial) > > ## MPT tree > sr_tree <- mpttree(cbind(E1, E2, E3, E4) ~ trial + group, + data = MemoryDeficits, cluster = ID, spec = mptspec("SR2"), alpha = 0.1) > > ## extract parameter estimates > coef(sr_tree) c r u 3 0.4611 0.4730 0.4239 4 0.4508 0.2438 0.3248 7 0.3738 0.2733 0.3090 8 0.4342 0.5557 0.4534 9 0.5978 0.8345 0.5842 > > options(digits = o$digits) > > > > cleanEx() detaching ‘package:strucchange’, ‘package:sandwich’, ‘package:zoo’ > nameEx("pctree") > ### * pctree > > flush(stderr()); flush(stdout()) > > ### Name: pctree > ### Title: Partial Credit Trees > ### Aliases: pctree plot.pctree print.pctree predict.pctree itempar.pctree > ### threshpar.pctree > ### Keywords: tree > > ### ** Examples > > o <- options(digits = 4) > > ## verbal aggression data from package psychotools > data("VerbalAggression", package = "psychotools") > > ## use response to the second other-to-blame situation (train) > VerbalAggression$s2 <- VerbalAggression$resp[, 7:12] > > ## exclude subjects who only scored in the highest or the lowest categories > VerbalAggression <- subset(VerbalAggression, rowSums(s2) > 0 & rowSums(s2) < 12) > > ## fit partial credit tree model > pct <- pctree(s2 ~ anger + gender, data = VerbalAggression) > > ## print tree (with and without parameters) > print(pct) Partial credit tree Model formula: s2 ~ anger + gender Fitted party: [1] root | [2] gender in female: n = 220 | s2S2WantCurse-C2 s2S2DoCurse-C1 s2S2DoCurse-C2 s2S2WantScold-C1 | 1.486 1.169 3.239 1.097 | s2S2WantScold-C2 s2S2DoScold-C1 s2S2DoScold-C2 s2S2WantShout-C1 | 2.903 2.006 4.791 1.618 | s2S2WantShout-C2 s2S2DoShout-C1 s2S2DoShout-C2 | 3.768 3.198 6.705 | [3] gender in male: n = 67 | s2S2WantCurse-C2 s2S2DoCurse-C1 s2S2DoCurse-C2 s2S2WantScold-C1 | 0.5547 -0.2179 -0.1240 0.8065 | s2S2WantScold-C2 s2S2DoScold-C1 s2S2DoScold-C2 s2S2WantShout-C1 | 1.7020 0.2919 1.7719 1.5697 | s2S2WantShout-C2 s2S2DoShout-C1 s2S2DoShout-C2 | 3.6675 2.1006 5.4388 Number of inner nodes: 1 Number of terminal nodes: 2 Number of parameters per node: 11 Objective function (negative log-likelihood): 899.9 > print(pct, FUN = function(x) " *") Partial credit tree Model formula: s2 ~ anger + gender Fitted party: [1] root | [2] gender in female * | [3] gender in male * Number of inner nodes: 1 Number of terminal nodes: 2 Number of parameters per node: 11 Objective function (negative log-likelihood): 899.9 > > ## show summary for terminal panel nodes > summary(pct) $`2` Partial credit model Item category parameters: Estimate Std. Error z value Pr(>|z|) s2S2WantCurse-C2 1.486 0.303 4.90 9.6e-07 *** s2S2DoCurse-C1 1.169 0.265 4.42 9.9e-06 *** s2S2DoCurse-C2 3.239 0.478 6.78 1.2e-11 *** s2S2WantScold-C1 1.097 0.266 4.12 3.8e-05 *** s2S2WantScold-C2 2.903 0.473 6.13 8.5e-10 *** s2S2DoScold-C1 2.006 0.270 7.44 1.0e-13 *** s2S2DoScold-C2 4.791 0.508 9.44 < 2e-16 *** s2S2WantShout-C1 1.618 0.268 6.04 1.5e-09 *** s2S2WantShout-C2 3.768 0.486 7.75 9.0e-15 *** s2S2DoShout-C1 3.198 0.296 10.80 < 2e-16 *** s2S2DoShout-C2 6.705 0.575 11.66 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -689 (df = 11) Number of iterations in BFGS optimization: 17 $`3` Partial credit model Item category parameters: Estimate Std. Error z value Pr(>|z|) s2S2WantCurse-C2 0.555 0.548 1.01 0.31136 s2S2DoCurse-C1 -0.218 0.507 -0.43 0.66709 s2S2DoCurse-C2 -0.124 0.780 -0.16 0.87361 s2S2WantScold-C1 0.807 0.464 1.74 0.08195 . s2S2WantScold-C2 1.702 0.789 2.16 0.03105 * s2S2DoScold-C1 0.292 0.453 0.64 0.51902 s2S2DoScold-C2 1.772 0.800 2.21 0.02681 * s2S2WantShout-C1 1.570 0.465 3.37 0.00074 *** s2S2WantShout-C2 3.667 0.878 4.18 3.0e-05 *** s2S2DoShout-C1 2.101 0.485 4.33 1.5e-05 *** s2S2DoShout-C2 5.439 1.038 5.24 1.6e-07 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -211 (df = 11) Number of iterations in BFGS optimization: 18 > > ## visualization > plot(pct, type = "regions") > plot(pct, type = "profile") > > ## extract item and threshold parameters > coef(pct) s2S2WantCurse-C2 s2S2DoCurse-C1 s2S2DoCurse-C2 s2S2WantScold-C1 2 1.4864 1.1691 3.239 1.0970 3 0.5547 -0.2179 -0.124 0.8065 s2S2WantScold-C2 s2S2DoScold-C1 s2S2DoScold-C2 s2S2WantShout-C1 2 2.903 2.0057 4.791 1.618 3 1.702 0.2919 1.772 1.570 s2S2WantShout-C2 s2S2DoShout-C1 s2S2DoShout-C2 2 3.768 3.198 6.705 3 3.667 2.101 5.439 > itempar(pct) s2S2WantCurse s2S2DoCurse s2S2WantScold s2S2DoScold s2S2WantShout s2S2DoShout 2 -1.1646 -0.288 -0.4561 0.4877 -0.02374 1.445 3 -0.8069 -1.146 -0.2332 -0.1983 0.74950 1.635 > threshpar(pct) s2S2WantCurse-C1 s2S2WantCurse-C2 s2S2DoCurse-C1 s2S2DoCurse-C2 2 -1.908 -0.4213 -0.7386 0.1626 3 -1.084 -0.5296 -1.3022 -0.9903 s2S2WantScold-C1 s2S2WantScold-C2 s2S2DoScold-C1 s2S2DoScold-C2 2 -0.8108 -0.1013 0.09792 0.8775 3 -0.2777 -0.1887 -0.79234 0.3958 s2S2WantShout-C1 s2S2WantShout-C2 s2S2DoShout-C1 s2S2DoShout-C2 2 -0.2893 0.2418 1.290 1.599 3 0.4855 1.0135 1.016 2.254 > > ## inspect parameter stability tests in the splitting node > if(require("strucchange")) sctest(pct, node = 1) Loading required package: strucchange Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich anger gender statistic 16.2334 4.354e+01 p.value 0.9578 1.746e-05 > > options(digits = o$digits) > > > > > cleanEx() detaching ‘package:strucchange’, ‘package:sandwich’, ‘package:zoo’ > nameEx("raschtree") > ### * raschtree > > flush(stderr()); flush(stdout()) > > ### Name: raschtree > ### Title: Rasch Trees > ### Aliases: raschtree print.raschtree plot.raschtree predict.raschtree > ### itempar.raschtree > ### Keywords: tree > > ### ** Examples > > o <- options(digits = 4) > > ## artificial data > data("DIFSim", package = "psychotree") > > ## fit Rasch tree model > rt <- raschtree(resp ~ age + gender + motivation, data = DIFSim) > plot(rt) > > ## extract item parameters > itempar(rt) resp1 resp2 resp3 resp4 resp5 resp6 resp7 resp8 resp9 resp10 3 0.41354 1.7416 4.053 0.2700 -0.2995 -1.237 -0.1562 0.12779 -1.831 -0.5928 4 0.05796 0.7298 1.026 0.8747 0.2539 -1.175 -1.0231 -0.07179 -1.419 0.1883 5 0.31447 0.4851 2.699 0.4851 -0.5527 -1.372 -0.7737 -0.06814 -1.504 0.5433 resp11 resp12 resp13 resp14 resp15 resp16 resp17 resp18 resp19 resp20 3 0.1278 -1.831 -1.065 -2.0719 -1.2368 1.9610 1.961 -0.15621 -0.5928 0.4135 4 -0.9493 -1.336 -1.175 0.5897 1.0258 1.3536 2.078 0.05798 -0.9493 -0.1367 5 0.6024 -1.864 -1.245 0.3145 0.9134 0.6623 1.589 -0.06814 -0.7178 -0.4442 > > ## inspect parameter stability tests in all splitting nodes > if(require("strucchange")) { + sctest(rt, node = 1) + sctest(rt, node = 2) + } Loading required package: strucchange Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich age gender motivation statistic 6.126e+01 0 86.252 p.value 3.613e-04 NA 0.926 > > ## highlight items 3 and 14 with DIF > ix <- rep(1, 20) > ix[c(3, 14)] <- 2 > plot(rt, ylines = 2.5, cex = c(0.4, 0.8)[ix], + pch = c(19, 19)[ix], col = gray(c(0.5, 0))[ix]) > > options(digits = o$digits) > > > > cleanEx() detaching ‘package:strucchange’, ‘package:sandwich’, ‘package:zoo’ > nameEx("rstree") > ### * rstree > > flush(stderr()); flush(stdout()) > > ### Name: rstree > ### Title: Rating Scale Trees > ### Aliases: rstree plot.rstree print.rstree predict.rstree itempar.rstree > ### threshpar.rstree > ### Keywords: tree > > ### ** Examples > > ## IGNORE_RDIFF_BEGIN > o <- options(digits = 4) > > ## verbal aggression data from package psychotools > data("VerbalAggression", package = "psychotools") > > ## responses to the first other-to-blame situation (bus) > VerbalAggression$s1 <- VerbalAggression$resp[, 1:6] > > ## exclude subjects who only scored in the highest or the lowest categories > VerbalAggression <- subset(VerbalAggression, rowSums(s1) > 0 & rowSums(s1) < 12) > > ## fit rating scale tree model for the first other-to-blame situation > rst <- rstree(s1 ~ anger + gender, data = VerbalAggression) > > ## print tree (with and without parameters) > print(rst) Rating scale tree Model formula: s1 ~ anger + gender Fitted party: [1] root | [2] gender in female | | [3] anger <= 23: n = 173 | | s1S1DoCurse s1S1WantScold s1S1DoScold s1S1WantShout s1S1DoShout | | 0.5054 0.5054 1.0954 1.0688 1.9563 | | C2 | | 0.8887 | | [4] anger > 23: n = 41 | | s1S1DoCurse s1S1WantScold s1S1DoScold s1S1WantShout s1S1DoShout | | -0.6582 0.3610 0.2247 0.5922 0.8799 | | C2 | | -0.7253 | [5] gender in male: n = 68 | s1S1DoCurse s1S1WantScold s1S1DoScold s1S1WantShout s1S1DoShout | -0.48160 0.35253 -0.06342 1.01438 1.60990 | C2 | 0.87640 Number of inner nodes: 2 Number of terminal nodes: 3 Number of parameters per node: 6 Objective function (negative log-likelihood): 975.8 > print(rst, FUN = function(x) " *") Rating scale tree Model formula: s1 ~ anger + gender Fitted party: [1] root | [2] gender in female | | [3] anger <= 23 * | | [4] anger > 23 * | [5] gender in male * Number of inner nodes: 2 Number of terminal nodes: 3 Number of parameters per node: 6 Objective function (negative log-likelihood): 975.8 > > ## show summary for terminal panel nodes > summary(rst) $`3` Rating scale model Item location and threshold parameters: Estimate Std. Error z value Pr(>|z|) s1S1DoCurse 0.505 0.157 3.21 0.0013 ** s1S1WantScold 0.505 0.157 3.21 0.0013 ** s1S1DoScold 1.095 0.166 6.58 4.6e-11 *** s1S1WantShout 1.069 0.166 6.44 1.2e-10 *** s1S1DoShout 1.956 0.194 10.08 < 2e-16 *** C2 0.889 0.157 5.65 1.6e-08 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -612 (df = 6) Number of iterations in BFGS optimization: 11 $`4` Rating scale model Item location and threshold parameters: Estimate Std. Error z value Pr(>|z|) s1S1DoCurse -0.658 0.316 -2.08 0.0374 * s1S1WantScold 0.361 0.303 1.19 0.2331 s1S1DoScold 0.225 0.301 0.75 0.4550 s1S1WantShout 0.592 0.308 1.92 0.0545 . s1S1DoShout 0.880 0.318 2.77 0.0056 ** C2 -0.725 0.347 -2.09 0.0367 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -132 (df = 6) Number of iterations in BFGS optimization: 12 $`5` Rating scale model Item location and threshold parameters: Estimate Std. Error z value Pr(>|z|) s1S1DoCurse -0.4816 0.2566 -1.88 0.06058 . s1S1WantScold 0.3525 0.2548 1.38 0.16650 s1S1DoScold -0.0634 0.2519 -0.25 0.80121 s1S1WantShout 1.0144 0.2731 3.71 0.00020 *** s1S1DoShout 1.6099 0.3034 5.31 1.1e-07 *** C2 0.8764 0.2568 3.41 0.00064 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -232 (df = 6) Number of iterations in BFGS optimization: 12 > > ## visualization > plot(rst, type = "regions") > plot(rst, type = "profile") > > ## extract item and threshold parameters > coef(rst) s1S1DoCurse s1S1WantScold s1S1DoScold s1S1WantShout s1S1DoShout C2 3 0.5054 0.5054 1.09541 1.0688 1.9563 0.8887 4 -0.6582 0.3610 0.22465 0.5922 0.8799 -0.7253 5 -0.4816 0.3525 -0.06342 1.0144 1.6099 0.8764 > itempar(rst) s1S1WantCurse s1S1DoCurse s1S1WantScold s1S1DoScold s1S1WantShout s1S1DoShout 3 -0.8552 -0.3498 -0.34978 0.240193 0.2135 1.1010 4 -0.2333 -0.8915 0.12775 -0.008599 0.3589 0.6466 5 -0.4053 -0.8869 -0.05277 -0.468721 0.6091 1.2046 > threshpar(rst) s1S1WantCurse-C1 s1S1WantCurse-C2 s1S1DoCurse-C1 s1S1DoCurse-C2 3 -1.2996 -0.4108 -0.7941 0.09459 4 0.1294 -0.5959 -0.5289 -1.25411 5 -0.8435 0.0329 -1.3251 -0.44870 s1S1WantScold-C1 s1S1WantScold-C2 s1S1DoScold-C1 s1S1DoScold-C2 3 -0.7941 0.09459 -0.2042 0.68456 4 0.4904 -0.23487 0.3540 -0.37123 5 -0.4910 0.38543 -0.9069 -0.03052 s1S1WantShout-C1 s1S1WantShout-C2 s1S1DoShout-C1 s1S1DoShout-C2 3 -0.2308 0.657908 0.6567 1.545 4 0.7216 -0.003693 1.0093 0.284 5 0.1709 1.047277 0.7664 1.643 > > ## inspect parameter stability tests in all splitting nodes > if(require("strucchange")) { + sctest(rst, node = 1) + sctest(rst, node = 2) + } Loading required package: strucchange Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich anger gender statistic 23.61167 0 p.value 0.01672 NA > > options(digits = o$digits) > ## IGNORE_RDIFF_END > > > > ### *