Group Discounts available for 3+ students and Corporate Clients

# SPSS Interview Questions

## SPSS Interview Questions with Answers

What is SPSS?

• SPSS is a computer application that gives measurable investigation of information.

– It considers inside and out information access and arrangement, explanatory announcing, illustrations and displaying.

– Its factual capacities run from straightforward rates to complex investigations of difference, numerous relapses, and general straight models.

• The numerous highlights of SPSS are open by means of pull-down menus or can be modified with a proprietary syntax language.

– Syntax programming has the advantages of reproducibility and taking care of complex information controls and investigations.

– Although Syntax dialect can sound threatening, it is anything but difficult to utilize.

• SPSS datasets dependably have 2-dimensional table structure where the columns normally speak to cases, (for example, people or family units) and the sections or factors speak to estimations, (for example, age, sex or family unit wage).
• SPSS can peruse and compose information from ASCII text files, different measurements bundles, spreadsheets and databases.

What is data view and variable view?

• In Data View, segments speak to factors, and columns speak to cases (perceptions).
• In Variable View, each line is a variable, and every section is a characteristic that is related with that variable.

What statistics analysis is included in SPSS?

• Distinct insights: Cross tabulation, Frequencies, Descriptives, Explore, Descriptive Ratio Statistics
• Bivariate insights: Means, t-test, ANOVA, Correlation (bivariate, halfway, separations), Nonparametric tests
• Expectation for numerical results: Linear relapse
• Expectation for recognizing gatherings: Factor examination, bunch investigation (two-advance, K-implies, various leveled), Discriminant

How to calculate the effect of educational intervention to drug prescription?

We can include the medication remedy status (yes or no) when instructive mediation. We can figure the chances proportion utilizing calculated relapse in SPSS.

How to Convert String into Date Variables?

To Convert String Variables to Date Variables the most preferable way is ALTER TYPE.

Those who are not familiar to ALTER TYPE, there are some alternative ways.

SPSS

ALTER TYPE:

Let us see the syntax below, here we create a mini dataset which holds a 8 string variables. Below syntax shows  the 8 most common date formats. And Next, the every string variable is converted to a date variable with the help of  ALTER TYPE.

String Variables to Date Variables Syntax:

The Date Format in ALTER TYPE says to SPSS that which component is the Day, Which component is the month, which component is the year.

For example:

3/3/9 which means 3rd March 2009, when we use EDATE8 (dd-mm-yy).

March 3rd 2009 when we use ADATE8 (mm-dd-yy) and so on as shown in the below Syntyax.

In the first string variable, the year, month and day might be isolated by a dash (- ), a slice (/), a period (.) or even a mix of these. It doesn’t make a difference which one is utilized.

On the off chance that two digits are utilized for a considerable length of time, numbers 0 through 44 are deciphered as years 2000 through 2044. Numbers 45 through 99 are deciphered as 1945 through 1999. For additional on this, see Two Digit Year in String – Cautionary Note.

ALTER TYPE overwrites existing qualities and isn’t reversible. It’s generally no enormous issue if things turn out badly here as long as you stick to sound practices, for example, working from linguistic structure. Moreover, you can utilize SPSS Clone Variables Tool before ALTER TYPE.

The Syntax of Above Example

Create mini dataset.

```data list free/d1 to d8(8a20).
begin data
31-dec-99 31.dec.1999 12/31/99 12-31-1999 31.12.99 31/12/1999 99-12-31 1999.12.31
end data.```

Convert all strings to dates.

```alter type d1(date9).
alter type d2(date11).
alter type d5(edate8).
alter type d6(edate10).
alter type d7(sdate8).
alter type d8(sdate10).```

String Variables to Date Variables without ALTER TYPE

Note that ALTER TYPE must be utilized for a set number of date designs. Some more intriguing arrangements may require a more adaptable methodology. Second, those on SPSS forms 15 and underneath don’t have ALTER TYPE since it was presented in variant 16.

For the two situations, we’ll typically separate the year, month and day by utilizing SUBSTR, regularly joined with INDEX and RINDEX. We’ll at that point convert these into a SPSS date variable by utilizing the DATE.DMY work. At last, we’ll show the quantity of seconds it holds as a more intelligible date by utilizing FORMATS.

How to Convert  SPSS String to Date Syntax?

Create mini dataset.

```data list free/s1 s2(2a20).
begin data
1.1.1999 1-jan-99 2.28.1999 2-feb-99 3.31.1999 3-mar-99 4.30.1999 4-apr-99 5.31.1999 5-may-99 6.30.1999 6-jun-99
7.31.1999 7-jul-99 8.31.1999 8-aug-99 9.30.1999 9-sep-99 10.31.1999 10-oct-99 11.30.1999 11-nov-99 12.31.1999 12-dec-99
end data.```

Extract day, month and year from string.

```compute day = number(char.substr(s1,char.index(s1,'.') + 1,char.rindex(s1,'.') - char.index(s1,'.')),f2.0).
compute month = number(char.substr(s1,1,char.index(s1,'.') - 1),f2.0).
compute year = number(char.substr(s1,char.rindex(s1,'.') +1),f4.0).
exe.```

Compute date variable.

```compute d1 = date.dmy(day,month,year).
exe.```

Display as date.

Dealing with Months as Letters

The previous example converted the first string variable but the second is slightly harder. This is because DATE.DMY requires three numbers but months are now shown as letters (e.g. JAN, FEB and so on). An easy way to fix this is to REPLACE the months by numbers (00 through 12) using DO REPEAT as shown below. After doing so, one can proceed as in the previous example.

*Replace month letters by month numbers in string.

```do repeat s = 'jan' 'feb' 'mar' 'apr' 'may' 'jun' 'jul' 'aug' 'sep' 'oct' 'nov' 'dec' / n = 1 to 12.
compute s2 = replace(s2,s,string(n,n2)).
end repeat.
exe.```

How to paste SPSS syntax?

Presently we should assume I’d jump at the chance to increase some knowledge into the rates of male and female respondents. I could initially explore to Analyze Descriptive measurements Frequencies as demonstrated as follows.

I’ll now move gender into the variable box and perhaps request a bar chart as well.

Now clicking Ok may seem the obvious thing to do. A much better idea, however, is to click the Paste button. Upon doing so, a new SPSS window opens which is known as the Syntax Editor. It’s recognized by the orange icon in its left top corner.

The Syntax Editor contains a FREQUENCIES order which holds the directions we just gave SPSS in the Frequencies exchange. Be that as it may, we don’t see the recurrence dispersion and bar graph we requested. This is on account of despite everything we have to run the order we just made.

What is SPSS REPLACE Function?

SPSS REPLACE replaces a substring in a string by a different (possibly empty) substring.

SPSS Replace – Removing Spaces

URLs are made from “title” by utilizing REPLACE. The Syntax underneath exhibits how to do this.

We have a dataset holding the titles of site pages and we’d get a kick out of the chance to change over these to URLs. For a certain something, we don’t care for spaces in URLs. The linguistic structure beneath demonstrates to expel them. Stage 1 makes a minor dataset (simply run and generally overlook it) and stage 3 exhibits how to expel spaces utilizing REPLACE.

How do I use a SAS data file in SPSS?

Using SPSS software:

In case you are a SPSS customer and you are using SPSS variation 14 or later, you can simply open it as a data record, since SPSS bolsters SAS data archives of different arrangements, for instance, .sas7bdat, .sd7, .sd2, .ssd01 and .xpt. These archives can be perused clearly into SPSS either by methods for using the draw down menu or by methods for using the sentence structure.

Using the draw down menus select File – > Open – > Data… and after that for Files of Type select the reasonable sas data record make; by then select the report from the summary and snap Open. That is all to it.

With SPSS language structure we can use the get sas order to peruse in a SAS data record.

get sas data=’C:datastates.sas7bdat’.

Using SAS software:

Now and again, there is a prerequisite for changing over a SAS archive to SPSS record outside of SPSS. For example, your partner is a SPSS customer who uses a more prepared adjustment of SPSS and you are a SAS customer working with SAS variation 9.x. For your partner to use comparative data in SPSS that you have tackled in SAS, you can simply change over your data in SAS to a SPSS data report for your accomplice.

In SAS, we can in like manner save a SAS data record as a SPSS data report using proc convey. For example, we have a SAS educational accumulation called mydata in the work index and we can do the going with to change over it to SPSS called newdata3.sav. By demonstrating the archive enlargement as .sav, SAS understands that we require our data record to be changed over to SPSS. Amid the time spent change, SAS will normally change over the variable names and regard names moreover.

proc convey data=mydata outfile= “C:datanewdata3.sav”;

Run;

Stat/Transfer:

There may be circumstances where neither alternatives above would work. For instance, in the event that somebody has a SAS information document, works with a more established adaptation of SPSS and does not approach SAS 9.x. Most likely the least demanding arrangement in this kind of circumstances is to utilize Stat/Transfer.