EDFILE= edit data file

Top Up Down  A A

This permits the replacement of data values in your data file with other values, without altering the data file. Data values are in the original data file format, specified in CODES=. If specified as decimals, they are rounded to the nearest integers. Additional persons can be entered beyond those in DATA= or after END LABELS. Values can be in any order, but are more speedily process in person-entry order.

 

EDFILE= file name

file containing details

EDFILE= file name + file name + ...

multiple files

EDFILE = *

in-line list

EDFILE = ?

opens a Browser window to find the file

 

Suggestion: sort the data lines as "person-entry-number ascending" for faster processing.

 

Its format is:

EDFILE=*

person entry number

or
"person selection"

*

 

item entry number
or
"item selection"

 

replacement data value

Ranges are permitted for entry numbers: first-last.

 

Person and item selections must be in quotation marks " ", and follow the selection rules:

 

Selection rules:

Control characters match label or name. They start at the first column of the label or name.

?

matches any character

*

matches any string of characters - must be last selection character.

A

matches A in the person label, and similarly all other characters except { }

{..}

braces characters which can match a single character: {ABC} matches A or B or C.

{.. - ..}

matches single characters in a range. {0-9} matches digits in the range 0 to 9.

{.. --..}

matches a single "-" {AB--} matches A or B or "-".

{~ABX}

omits person records which match A or B or X

 

Example 1: In your MCQ test, you wish to correct a data-entry error. Person 23 responded to item 17 with a D, not whatever is in the data file.

 

 EDFILE=*

 23 17 D     ; person 23, item 17, data value of D

 *

 

Example 2: Person 43 failed to read the attitude survey instructions correctly for items 32-56. Mark these missing.

 

 43 32-56 " " ; person 43, items 32 to 56, blanks are missing data.

 

Example 3: Persons 47-84 are to be given a rating of 4 on item 16.

 

 47-84 16 4 ; persons 47 to 84, item 16, data value of 4

 

Example 4: Items 1-10 are all to be assigned a datum of 1 for the control subsample, persons 345-682.

 

 345-682 1-10 1 ; persons 345-682, items 1 to 10, data value 1.

 

Example 5: Missing data values are to be imputed with the values nearest to their expectations.

 

a. Produce PFILE=, IFILE= and SFILE= from the original data (with missing).

b. Use those as PAFILE=, IAFILE=, SAFILE= anchor files with a data set in which all the original non-missing data are made missing, and vice-versa - it doesn't matter what non-missing value is used.

c. Produce XFILE= to obtain a list of the expected values of the originally missing data.

d. Use the EDFILE= command to impute those values back into the data file. It will round expected values to the nearest integer, for us as a category value.

 

 17 6 2.6 ; persons 17, item 6, expected value 2.6, imputed as category "3".

 

Example 6: All responses to item 6 for males "M" in column 6 of person label are to be coded as "missing":

"?????M" 6 .

 

Example 7: Exceedingly unexpected responses are to be coded "missing". (It is easier, but not as exact, to use CUTLO= and CUTHI= to trim the observations).

 

Either

Obtain list of unexpected observations from Table 6.6 or Table 10.6.

Copy-and-paste them into Excel

Excel: "Data", "Text to columns" to separate the columns

Or

Output the XFILE= to Excel

Sort by unexpectedness (standardized residual)

Delete all rows except for the responses you want to code missing

Then

Rearrange the columns: Person Item

In the third column put the desired missing data code.

Copy-and-paste the three columns into a text file.

In your Winsteps control file:

EDFILE = (text file name)

Rerun the analysis

 

Example 8: All data in a separate EDFILE= data file.

 

NAME1 = 1

ITEM1 = 31

NI = (number of items)

CODES = ABCD

EDFILE= *

1 1 A

1 5 B

2 3 A

2 10 C

.....

*

&END

....

END LABELS

(list of person labels or nothing)

NAME1 = 1

ITEM1 = 31

NI = (number of items)

CODES = ABCD

EDFILE= eddata.txt

DATA = personlabels.txt  ; list of person labels

....

&END

....

END LABELS

 

and in another file, eddata.txt,

1 1 A

1 5 B

2 3 A

2 10 C

.....