Column sum in SPSS (with filter and grouped by date)?

device date act power 1 react power 2 ------------------------------------------------- M1 05-02 2 3 M2 05-02 4 2 M3 05-02 3 4 M1 06-02 1 2 M2 07-02 3 4 ------- ------- need sum need sum Say that I only need the sum of M1 and M2 from that table. How could I add a variable that contains the sum of power group by date and device? I don't know if it is desired to have something like this? Or how …
Category: Data Science

Doing a cox regression, how do I analyze a continuous variable in which a lower result is worse?

I have this variable that is clinically worse the lower it is. Instead of interpreting, for example, a hazard ratio of 0.9 as "per unit increase in variable x, there is a x% reduction in risk for mortality", I want to get a >1 HR (for ex 1.05) and say "per unit decrease in variable x there is a 5% higher risk for mortality". How do I handle this using SPSS?
Category: Data Science

How to model multinomail logistic regression to get desired outcome?

I want to run multinomial logistic regression in SPSS. Dependent variable: Code=0 Cognitively normal(CN) Code=1 Mild cognitive normal(MCI) Code=3 Alzheimer’s(AD) Independent variable: Genotype.1=0 Genotype.2=1 Genotype.3=2 What I want to know is: How much is OR (odds ratio) for CN to get MCI and how much is the OR for CN to get AD? If I consider MCI as a reference group, then I can see the OR for CN to get MCI and AD to get MCI (I do not …
Category: Data Science

Why do I get different coefficients from Logistic regression in Python and SPSS

I am a bit confused in regards to the model coefficients calculated by SPSS and sklearn's LogisticRegression. I am getting different coefficients and intercepts for both methods. in Python, I am running the following code: import numpy as np from sklearn.linear_model import LogisticRegression vals = [0.01, 0.04, 0.07, 0.08, 0.08, 0.09, 0.10, 0.15, 0.20, 1.85, 1.93, 1.97 ,2.02, 2.09, 2.12, 2.13, 2.21, 2.25] labels = [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, …
Category: Data Science

Distinction of different types of missing values is lost after importing data from SPSS into R

I've got a file containing survey data in SPSS. There are 3 types of missing values defined: invalid (coded as 900), not applicable (990), not filled in (999). After importing the SPSS file into R using haven library, all types are coded as "NA", the distinction is lost. How do you deal with this if distinction is important?
Category: Data Science

Checking Correlation of Categorical variables in SPSS

I am building a predictive model for a classification problem using SPSS. Of the Independent variables, I have both Continuous and Categorical variables. SPSS gives only correlation between continuous variables. Is there a way in SPSS to find the correlation a)between two categorical variables b)between categorical and continuous variables?
Category: Data Science

Assigning numerical IDs to variable values in a data file

I have the problem that I got a huge source data file which is showing text for all variable values instead of numerical IDs. So for example, I would like to have the variable gender coded as 1 and 2 instead of "female" and "male" written out. And equally the same for 200 other variables of which some have up to hundreds of distinct variable values. Therefore, doing this manually is not really an option here. Could anybody please point …
Topic: spss python r
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.