Statalist The Stata Listserver


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

RE: st: ignore message:destring id - for attnd matching in pscore


From   "Gauri Khanna" <[email protected]>
To   [email protected]
Subject   RE: st: ignore message:destring id - for attnd matching in pscore
Date   Tue, 24 Apr 2007 09:29:35 +0000

Dear Stata list,

I was able to find a solution for my problem.

I used -gen idmatch = real(subinstr(hhid, " ", "", .))-

Please ignore the message.

Sincerely,

Gauri
From: "Gauri Khanna" <[email protected]>
Reply-To: [email protected]
To: [email protected]
Subject: st: destring id - for attnd matching in pscore
Date: Tue, 24 Apr 2007 08:24:25 +0000

Dear Statalist,

I am using -pscore- module to conduct matching using the nearest neighbour match with -attnd-. I would like to do some post-matching analysis and would like to restrict my data to the matched group. I looked up -help attnd- and ran the following command.

-attnd h11 wellsan v012 sexhhead v119 v136 v152 aware v730 v705 ///
rooms1to3 rooms4to5 propadult propwomen propmen v715 ///
v717 v714 v136v119 v715aware sh42 sh43 sh46 sh42sexhh ///
v730v119, pscore(pscorewellsan) comsup matchvar(scorewellsan) matchdta(scorewellsan) id(hhid) boot reps(50) dots logit-

1. However, when I look at my data, I have all mising values for my id variable "hhid". hhid = household id, is a string variable and which I have used in the command above so that I can subsequently use this identifier to merge with my original dataset and conduct the post-matching analysis. I have listed "hhid" below so you can see what it looks like.

So I tried to destring my "hhid" variable but it gave the following error

- destring hhid, gen(IDmatch)-
hhid contains non-numeric characters; no generate


Then I used the -ignore- and -force- option but I got all missing values for "hhid". How can I convert it to a numeric value so that I can use it with -attnd-?

I will be grateful for your advice.

Sincerely,

Gauri

des hhid

storage display value
variable name type format label variable label
-------------------------------------------------------------------------------
hhid str12 %12s

. list hhid

+--------------+
| hhid |
|--------------|
1. | 2 1 66 |
2. | 2 1 93 |
3. | 2 1 111 |
4. | 2 1 147 |
5. | 2 1 174 |
|--------------|
6. | 2 1 201 |
7. | 2 1 237 |
8. | 2 1 255 |
9. | 2 2 65 |
10. | 2 2 95 |
|--------------|
11. | 2 2 130 |
12. | 2 3 25 |
13. | 2 3 55 |
14. | 2 3 91 |
15. | 2 3 97 |
|--------------|

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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