Fw: SEEKING HELP WITH MATCH FILES - ONE TO MANY MERGE - REPLY - syntax works-partially

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Fw: SEEKING HELP WITH MATCH FILES - ONE TO MANY MERGE - REPLY - syntax works-partially

thara vardhan-2
Hi David

Thanks you so much for helping me with the match file problem. I used the following syntax

MATCH FILES / FILE * / TABLE "unique.sav"/ BY  Erefnum  increfnum PersCNI .

ADD FILES/FILE *  / IN=@M@ /FILE "unique.sav" /IN=@U@/  BY Erefnum  increfnum

PersCNI.

COMPUTE

#FLAG=SUM(Erefnum-LAG(Erefnum),increfnum-LAG(increfnum),PersCNI-LAG(PersCNI))

EQ 0 AND LAG(@M@) AND @U@.

SELECT IF NOT #FLAG.

SAVE OUTFILE ' TESTING'.



Got an error message  Error # 63 in column 30.  Text: unique.sav

The file does not exist.

Execution of this command stops.


So I substituted the filename “unique.sav” with the actual dataset number –
the syntax works fine but I get only 2 new variables as @M@ and @U@
in the new data file testing.sav



MATCH FILES / FILE * / TABLE dataset10/ BY  Erefnum  increfnum PersCNI .

ADD FILES/FILE *  / IN=@M@ /FILE dataset10 /IN=@U@/  BY Erefnum  increfnum

PersCNI.

COMPUTE

#FLAG=SUM(Erefnum-LAG(Erefnum),increfnum-LAG(increfnum),PersCNI-LAG(PersCNI))

EQ 0 AND LAG(@M@) AND @U@.

SELECT IF NOT #FLAG.

SAVE OUTFILE ' TESTING'.


Can you help me please?


As you have correctly pointed out I should have outlined the format of the current data files and
also what the format of the output data file that I am looking for.


So here is my request for help again:


UNIQUE.SAV (51330 RECORDS)

ERefNum

IncRefNUm

PersCNI

IncidentCategory

IncidentFurtherClassification

LKAAddress

LKASuburb

LKAPostcode

UniqueParties


MULTI.SAV (624 RECORDS) - there are 24 cases (ErefIncrefPerscni) with duplicate records -  These are due to a) multiple law part codes b) a person can have both court and non court actions in one event - that is  CHARGE (shown as chargerefno) and an INFRINGEMENT NOTICE(infringement number). c) a young person can be given a charge and youth ConferenceYOA (type of legal action) d) if the a young person has been given a  youth Conference YOA - he has 3 or 4 records because law part codes are different.


ERefNum

IncRefNUm

PersCNI

LawPartCode

ChargeRefNo

InfringementNumber

LegalAction

LegalActDate

LegalActMonth

CourtName

CourtType

FirstCourtAppearanceDate

NextCourtAppearanceDate

NextCourtAppearanceType

LawPartTitle

LawPartDescr

CourtResult

ChargeTime24h

CANServedDate

CANServedTime24h

CANs

Outcome

NCA


MATCH RESULT FILE (51330 THAT INCLUDES THE 624) THAT I HAVE TO CREATE


ERefNum

IncRefNUm

PersCNI

IncidentCategory

IncidentFurtherClassification

LKAAddress

LKASuburb

LKAPostcode

UniqueParties

LawPartCode

ChargeRefNo

InfringementNumber

LegalAction

LegalActDate

LegalActMonth

CourtName

CourtType

FirstCourtAppearanceDate

NextCourtAppearanceDate

NextCourtAppearanceType

LawPartTitle

LawPartDescr

CourtResult

ChargeTime24h

CANServedDate

CANServedTime24h

CANs

Outcome

NCA


Many thanks

thara vardhan







_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The information contained in this email is intended for the named recipient(s)
only. It may contain private, confidential, copyright or legally privileged
information. If you are not the intended recipient or you have received this
email by mistake, please reply to the author and delete this email immediately.
You must not copy, print, forward or distribute this email, nor place reliance
on its contents. This email and any attachment have been virus scanned. However,
you are requested to conduct a virus scan as well. No liability is accepted
for any loss or damage resulting from a computer virus, or resulting from a delay
or defect in transmission of this email or any attached file. This email does not
constitute a representation by the NSW Police Force unless the author is legally
entitled to do so.


Reply | Threaded
Open this post in threaded view
|

Automatic reply: SEEKING HELP WITH MATCH FILES - ONE TO MANY MERGE - REPLY - syntax works-partially

Mikki Haegle

I am off enjoying some vacation time.

I will return on June 5th and will respond to messages once I am back in the Lab.

 

~M

 

 

 

 

Mikki Haegle

Psychology Lab Coordinator

700 E 7th Street, NM-L202

St Paul, MN 55106

651.793.1354

 

Reply | Threaded
Open this post in threaded view
|

Re: Fw: SEEKING HELP WITH MATCH FILES - ONE TO MANY MERGE - REPLY - syntax works-partially

San K
In reply to this post by thara vardhan-2
There are few things to note.
1. Make sure your file path is correct for your unique.sav. Generally I simply define the high level path and then refer other files from there.
Eg:
DEFINE !projDir() 'D:\BasixComplianceAnalysis_San\' !ENDDEFINE.
Then you can refer to any other files as
GET FILE = !projDir + ‘analysis\unique.sav’.

This enables me to easily move folders. Also it doesn't depend on the default working dir.

2. Always use ‘EXECUTE’ after using LAG.

3. I generally use ‘EXECUTE’ after a ‘MATCH’ so any errors related to the match is immediately reported.

4. Use commands such as FREQ, CROSSTAB or DESCRIPTIVE every now and then. It will slowdown the process but you can keep an eye on how things are going.


Regards,
San



On Thu, May 24, 2012 at 8:34 AM, Thara Vardhan <[hidden email]> wrote:
Hi David

Thanks you so much for helping me with the match file problem. I used the following syntax

MATCH FILES / FILE * / TABLE "unique.sav"/ BY  Erefnum  increfnum PersCNI .

ADD FILES/FILE *  / IN=@M@ /FILE "unique.sav" /IN=@U@/  BY Erefnum  increfnum

PersCNI.

COMPUTE

#FLAG=SUM(Erefnum-LAG(Erefnum),increfnum-LAG(increfnum),PersCNI-LAG(PersCNI))

EQ 0 AND LAG(@M@) AND @U@.

SELECT IF NOT #FLAG.

SAVE OUTFILE ' TESTING'.



Got an error message  Error # 63 in column 30.  Text: unique.sav

The file does not exist.

Execution of this command stops.


So I substituted the filename “unique.sav” with the actual dataset number –
the syntax works fine but I get only 2 new variables as @M@ and @U@
in the new data file testing.sav



MATCH FILES / FILE * / TABLE dataset10/ BY  Erefnum  increfnum PersCNI .

ADD FILES/FILE *  / IN=@M@ /FILE dataset10 /IN=@U@/  BY Erefnum  increfnum

PersCNI.

COMPUTE

#FLAG=SUM(Erefnum-LAG(Erefnum),increfnum-LAG(increfnum),PersCNI-LAG(PersCNI))

EQ 0 AND LAG(@M@) AND @U@.

SELECT IF NOT #FLAG.

SAVE OUTFILE ' TESTING'.


Can you help me please?


As you have correctly pointed out I should have outlined the format of the current data files and
also what the format of the output data file that I am looking for.


So here is my request for help again:


UNIQUE.SAV (51330 RECORDS)

ERefNum

IncRefNUm

PersCNI

IncidentCategory

IncidentFurtherClassification

LKAAddress

LKASuburb

LKAPostcode

UniqueParties


MULTI.SAV (624 RECORDS) - there are 24 cases (ErefIncrefPerscni) with duplicate records -  These are due to a) multiple law part codes b) a person can have both court and non court actions in one event - that is  CHARGE (shown as chargerefno) and an INFRINGEMENT NOTICE(infringement number). c) a young person can be given a charge and youth ConferenceYOA (type of legal action) d) if the a young person has been given a  youth Conference YOA - he has 3 or 4 records because law part codes are different.


ERefNum

IncRefNUm

PersCNI

LawPartCode

ChargeRefNo

InfringementNumber

LegalAction

LegalActDate

LegalActMonth

CourtName

CourtType

FirstCourtAppearanceDate

NextCourtAppearanceDate

NextCourtAppearanceType

LawPartTitle

LawPartDescr

CourtResult

ChargeTime24h

CANServedDate

CANServedTime24h

CANs

Outcome

NCA


MATCH RESULT FILE (51330 THAT INCLUDES THE 624) THAT I HAVE TO CREATE


ERefNum

IncRefNUm

PersCNI

IncidentCategory

IncidentFurtherClassification

LKAAddress

LKASuburb

LKAPostcode

UniqueParties

LawPartCode

ChargeRefNo

InfringementNumber

LegalAction

LegalActDate

LegalActMonth

CourtName

CourtType

FirstCourtAppearanceDate

NextCourtAppearanceDate

NextCourtAppearanceType

LawPartTitle

LawPartDescr

CourtResult

ChargeTime24h

CANServedDate

CANServedTime24h

CANs

Outcome

NCA


Many thanks

thara vardhan







_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The information contained in this email is intended for the named recipient(s)
only. It may contain private, confidential, copyright or legally privileged
information. If you are not the intended recipient or you have received this
email by mistake, please reply to the author and delete this email immediately.
You must not copy, print, forward or distribute this email, nor place reliance
on its contents. This email and any attachment have been virus scanned. However,
you are requested to conduct a virus scan as well. No liability is accepted
for any loss or damage resulting from a computer virus, or resulting from a delay
or defect in transmission of this email or any attached file. This email does not
constitute a representation by the NSW Police Force unless the author is legally
entitled to do so.



Reply | Threaded
Open this post in threaded view
|

Re: Fw: SEEKING HELP WITH MATCH FILES - ONE TO MANY MERGE - REPLY - syntax works-partially

David Marso
Administrator
In reply to this post by thara vardhan-2
Since you have only posted your partial syntax I can only assume that the initial MATCH may have failed or the active file was the FILE=* as well as the TABLE or there was some other error?

Thara Vardhan wrote
Hi David

Thanks you so much for helping me with the match file problem. I used the
following syntax

MATCH FILES / FILE * / TABLE "unique.sav"/ BY  Erefnum  increfnum PersCNI
.
ADD FILES/FILE *  / IN=@M@ /FILE "unique.sav" /IN=@U@/  BY Erefnum
 increfnum
PersCNI.
COMPUTE
#FLAG=SUM(Erefnum-LAG(Erefnum),increfnum-LAG(increfnum),PersCNI-LAG(PersCNI))

EQ 0 AND LAG(@M@) AND @U@.
SELECT IF NOT #FLAG.
SAVE OUTFILE ' TESTING'.


Got an error message  Error # 63 in column 30.  Text: unique.sav
The file does not exist.
Execution of this command stops.

So I substituted the filename ?unique.sav? with the actual dataset number
?
the syntax works fine but I get only 2 new variables as @M@ and @U@
in the new data file testing.sav


MATCH FILES / FILE * / TABLE dataset10/ BY  Erefnum  increfnum PersCNI .
ADD FILES/FILE *  / IN=@M@ /FILE dataset10 /IN=@U@/  BY Erefnum  increfnum

PersCNI.
COMPUTE
#FLAG=SUM(Erefnum-LAG(Erefnum),increfnum-LAG(increfnum),PersCNI-LAG(PersCNI))

EQ 0 AND LAG(@M@) AND @U@.
SELECT IF NOT #FLAG.
SAVE OUTFILE ' TESTING'.

Can you help me please?

As you have correctly pointed out I should have outlined the format of the
current data files and
also what the format of the output data file that I am looking for.

So here is my request for help again:

UNIQUE.SAV (51330 RECORDS)
ERefNum
IncRefNUm
PersCNI
IncidentCategory
IncidentFurtherClassification
LKAAddress
LKASuburb
LKAPostcode
UniqueParties

MULTI.SAV (624 RECORDS) - there are 24 cases (ErefIncrefPerscni) with
duplicate records -  These are due to a) multiple law part codes b) a
person can have both court and non court actions in one event - that is
 CHARGE (shown as chargerefno) and an INFRINGEMENT NOTICE(infringement
number). c) a young person can be given a charge and youth ConferenceYOA
(type of legal action) d) if the a young person has been given a  youth
Conference YOA - he has 3 or 4 records because law part codes are
different.

ERefNum
IncRefNUm
PersCNI
LawPartCode
ChargeRefNo
InfringementNumber
LegalAction
LegalActDate
LegalActMonth
CourtName
CourtType
FirstCourtAppearanceDate
NextCourtAppearanceDate
NextCourtAppearanceType
LawPartTitle
LawPartDescr
CourtResult
ChargeTime24h
CANServedDate
CANServedTime24h
CANs
Outcome
NCA

MATCH RESULT FILE (51330 THAT INCLUDES THE 624) THAT I HAVE TO CREATE

ERefNum
IncRefNUm
PersCNI
IncidentCategory
IncidentFurtherClassification
LKAAddress
LKASuburb
LKAPostcode
UniqueParties
LawPartCode
ChargeRefNo
InfringementNumber
LegalAction
LegalActDate
LegalActMonth
CourtName
CourtType
FirstCourtAppearanceDate
NextCourtAppearanceDate
NextCourtAppearanceType
LawPartTitle
LawPartDescr
CourtResult
ChargeTime24h
CANServedDate
CANServedTime24h
CANs
Outcome
NCA

Many thanks
thara vardhan




_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The information contained in this email is intended for the named recipient(s)
only. It may contain private, confidential, copyright or legally privileged
information.  If you are not the intended recipient or you have received this
email by mistake, please reply to the author and delete this email immediately.
You must not copy, print, forward or distribute this email, nor place reliance
on its contents. This email and any attachment have been virus scanned. However,
you are requested to conduct a virus scan as well.  No liability is accepted
for any loss or damage resulting from a computer virus, or resulting from a delay
or defect in transmission of this email or any attached file. This email does not
constitute a representation by the NSW Police Force unless the author is legally
entitled to do so.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Interaction in Regression Models

Jarrod Teo-2
Hi,
 
I have a question to clarify on interaction with Linear Regression.
 
May I know if the following suggestions are true?
 
Suggestion 1
 

The interaction between 2 variables is enough to rule out the relationship.

If no interaction between A&B, then there will not have any interaction between all the ABx, ABxx, ...,ABxxZ.

 
 

 

Suggestion 2

 

So does this means that if a project is needed to build the following model.
 

Y=M1*A+M2*B+M3*C+M4*D+…+ M1 M2*A B+ M1 M3*AC+ M1 M4*AD+…+ M1 M2 M3*ABC+….+M1M2…..MnABCDEF…..Z + Constant

 

Just testing the following will do?

 

In order to find variables that have no interaction with others w/o using statisitcal model, you got to go to basic method plotting  a pair of variables A vs B, A vs C,…, Y vs Z. For any pair that they don’t have interaction, the plot will demonstrate a random pattern.

Hence for a variable that doesn’t have any interaction with others, it must show random pattern in all plots with other variables.

 

Thanks for any suggestions.

 

Warmest Regards

Dorraj Oet

 

Reply | Threaded
Open this post in threaded view
|

Re: Interaction in Regression Models

David Marso
Administrator
Just as it is possible to have non significant main effects but have a sig 2 way interaction, it is possible to have non sig main effects, non sig 2 way effects but a significant 3 way interaction.  So, each of your 'suggestions' are demonstrably FALSE!
--
DorraJ Oet wrote
Hi,

I have a question to clarify on interaction with Linear Regression.

May I know if the following suggestions are true?

Suggestion 1

The interaction between 2 variables is enough to rule out the relationship.
If no interaction between A&B, then there will not have any interaction between all the ABx, ABxx, ...,ABxxZ.



Suggestion 2

So does this means that if a project is needed to build the following model.

Y=M1*A+M2*B+M3*C+M4*D+…+ M1 M2*A B+ M1 M3*AC+ M1 M4*AD+…+ M1 M2 M3*ABC+….+M1M2…..MnABCDEF…..Z + Constant

Just testing the following will do?

In order to find variables that have no interaction with others w/o using statisitcal model, you got to go to basic method plotting  a pair of variables A vs B, A vs C,…, Y vs Z. For any pair that they don’t have interaction, the plot will demonstrate a random pattern.
Hence for a variable that doesn’t have any interaction with others, it must show random pattern in all plots with other variables.


Thanks for any suggestions.

Warmest Regards
Dorraj Oet
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"