[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st:How to input a portion of a file

From   Joseph Wagner <>
Subject   st:How to input a portion of a file
Date   Mon, 18 Feb 2008 09:26:54 -0500

I have data I wish to input a portion of into STATA.  Data is collected
on patients by a machine that measures their gait as they walk.  A text
file is output for each patient with columns representing variables
(each about 130 lines long) but the multiple observation data doesn't
start until line 29.  The first 28 lines are taken up with short lines
of data describing the patient.  Unfortunately, I also need a couple of
those lines in 'header' area.  The 29th line has the variables names but
they do not line up directly with the columns of data so I figured I
could just label the data later.  The data I need starts 30 lines down
at column 115 and includes the next 4 columns and goes down 100 lines.

I realize there are easier ways to do this but I have data on about 300
patients (and so one file for each person) and wanted to automate this
input (followed by successive merging of files to get my final dataset).

I wanted to use the -infix- command but have never used this command
before and my attempts so far have failed.  I also tried using -infile-
with the _first(30) option and the _line(30) option but those didn't
seem to work either.

Here is a dictionary I attempted with just one of the variables:

dictionary using "c:\data\gait\SBS00001_20050607_1.nrm" {
      _column(115) r_grf_vrt_frc %5f

infile using SBS00001_20050607_1.dct

unexpected end of file
(5 observations read)

The other problem is that it didn't seem to pull the data corresponding
to that column.  I thought perhaps there was a problem with the data not
being in a fixed format but if I try -insheet- all the data imports and
the correct data lines up in the individual columns.  Of course I could
write some programming whereby I delete the unneeded variables and line
but that's kind of sloppy.

I am using STATA ver. 8.2

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index