spss

Standardized regression coefficients with dummy variables in R vs. SPSS

谁说我不能喝 提交于 2020-06-17 02:03:07
问题 I came across a puzzling difference in standardized (beta) coefficients with linear regression model computed with R and SPSS using dummy coded variables. I have used the hsb2 data set and created a contrast (dummy coding), so that the third category is the reference. Here is the R code: # Read the data hsb2 <- read.table('https://stats.idre.ucla.edu/stat/data/hsb2.csv', header = TRUE, sep = ",") # Create a factor variable with respondents' race hsb2$race.f <- factor(hsb2$race, labels = c(

Looping through parallel lists/arrays in an SPSS macro

天涯浪子 提交于 2020-03-23 09:54:09
问题 I would like to write a SPSS macro to perform three operations: generate a custom table, clean the output window, export table. As you know SPSS macro facility allows to use two types of loops: 'numeric' like ( !do !i = !x !to !y ) and 'list'/'for each' like ( !do !i !in (!1) ). My goal is to create a macro with a call as below: col v1 v2 / "Sheet A" "Sheet B". working this way (with a 'list' like loop): Get first variable name (v1) Put it in the ctables macro section Get first sheet name

Looping through parallel lists/arrays in an SPSS macro

最后都变了- 提交于 2020-03-23 09:52:36
问题 I would like to write a SPSS macro to perform three operations: generate a custom table, clean the output window, export table. As you know SPSS macro facility allows to use two types of loops: 'numeric' like ( !do !i = !x !to !y ) and 'list'/'for each' like ( !do !i !in (!1) ). My goal is to create a macro with a call as below: col v1 v2 / "Sheet A" "Sheet B". working this way (with a 'list' like loop): Get first variable name (v1) Put it in the ctables macro section Get first sheet name

数据挖掘产品 IBM SPSS Modeler 新手使用入门

随声附和 提交于 2020-03-02 09:18:58
IBM SPSS Modeler 简介 作为 IBM 分析与预测解决方案的重要组成部分,IBM SPSS Modeler 是一组数据挖掘工具,通过这些工具可以采用商业技术快速建立预测性模型,并将其应用于商业活动,从而改进决策过程。随着于 2010 年其新版本 14.1 的发布,名字也由 PASW Modeler 更名为现在的 IBM SPSS Modeler 。 SPSS Modeler 提供了各种借助机器学习、人工智能和统计学的建模方法。通过建模选项板中的方法,您可以根据数据生成新的信息以及开发预测模型。每种方法各有所长,同时适用于解决特定类型的问题。 初次上手 典型的 SPSS Modeler 界面如下: 图 1. SPSS Modeler 界面 接下来将详细介绍其基本概念及操作。 基本概念:节点 节点代表要对数据执行的操作。 例如,假定您需要打开某个数据源、添加新字段、根据新字段中的值选择记录,然后在表中显示结果。在这种情况下,您的数据流应由以下四个节点组成: 表 1. 节点示例 变量文件节点,设置此节点后可以读取数据源中的数据。 导出节点,用于向数据集中添加计算的新字段。 选择节点,用于设置选择标准,以从数据流中排除某些记录。 表节点,用于在屏幕上显示操作结果。 基本概念:数据流 SPSS Modeler 进行的数据挖掘重点关注通过一系列节点运行数据的过程

IBM SPSS Modeler随机森林算法介绍

会有一股神秘感。 提交于 2020-03-01 16:50:07
在之前的文章《Bagging 或Boosting让你的模型更加优化》中,我们介绍了可以通过Bagging或Boosting技术,使得模型更加稳定和准确率更高,那么今天要介绍的随机森林算法,本身的算法逻辑已经使用了Bagging技术,来构建多棵树,最终实现构建“森林”的目的。 首先我们先来了解下这个算法,记住几个要点就可以: 1.在 IBM SPSS Modeler 中,随机森林构建的每棵树,使用的算法是C&RT,关于C&RT算法的介绍可以参考之前的文章《 IBM SPSS Modeler算法系列------C&R Tree算法介绍 》; 2.使用Bagging,每构建一棵树,都是通过随机选择样本数据来构建(有放回的); 3.除了使用Bagging技术,对使用的输入指标,也随机选择。比如说一共有20个输入指标,每选完一次样本数据后,会再随机选择其中的10个指标来构建树。 4.最终的预测结果,会综合前面构建的决策树通过投票的方式得到最终的预测结果,如果是数值型的预测,则是取平均值做为最终的预测结果。 5.在 IBM SPSS Modeler 中,随机森林算法不仅支持传统的关系型数据库,比如DB2、Oracle、SQL Server等通过ODBC可连接的数据库,也支持Haoop分布式架构的数据,它可以生成MapReduce或者Spark,放到Hadoop平台上去执行,从而提升整个计算效率

Loop through items and sum items in SPSS

断了今生、忘了曾经 提交于 2020-01-25 11:23:12
问题 I have two sets of variables called ITEM 1 to ITEM 47, and another called L1 to L47. What I want to do is to calculate the sum of Ls if any ITEM#i=1. What I wrote is as following: COMPUTE LSUM=0. LOOP #i=1 to 47. IF (ITEM(#i)=1) LSUM=LSUM+L(#i). END LOOP. But I got an error message saying the characters do not match any existing function or vector. What should I do then? Your inputs will be very appreciated. Thanks. Sincerely, Lucy 回答1: COMPUTE LSUM=0. exe. vector vitems = ITEM 1 to ITEM 47.

Dynamically create value labels with haven::labelled

可紊 提交于 2020-01-24 23:42:07
问题 I am using haven::labelled to set value labels of a variable. The goal is to create a fully documented dataset I can export to SPSS. Now, say I have a df value_labels of values and their value labels. I also have i df df_data with variables to which I want allocate value labels. value_labels <- tibble( value = 1:6, labels = paste0("value", 1:6) ) df_data <- tibble( id = 1:10, var = floor(runif(10, 1, 6)) ) Manually, I would create value labels for df_data$var like so: df_data$var <- haven:

Saving data from SPSS to Excel - custom sheet name

删除回忆录丶 提交于 2020-01-24 19:06:31
问题 Is it possible, When exporting a dataset from SPSS to Excel, to control the name of the worksheet the data is being saved into ? The "SAVE TRANSLATE OUTFILE" command does not allow for this. I have SPSS 21, with Python installed (although I am fairly new to Python...) 回答1: Yes. See this weblink on IBM website for details. get file="C:\Program Files\IBM\SPSS\Statistics\23\Samples\English\Employee data.sav". SAVE TRANSLATE /TYPE=ODBC /CONNECT='DSN=Excel Files;DBQ=C:\Daten\Temp

Query SQL Server from SPSS how to connect

余生长醉 提交于 2020-01-16 09:35:50
问题 I am at a total loss on how to do what I think is a fairly simple and standard task: I am running SPSS 20 on Mac and want to connect to a SQL Server database on a remote server. When going to File -> Open Database -> New Query (The command names may be a bit off, my SPSS is in German and I'm just translating) it only shows myodbc as data source. I assume I have to add a driver for SQL Server however I don´t really know where to get it or how to install it as I cannot find it in the SPSS