BookmarkSubscribeRSS Feed
hmj
Calcite | Level 5 hmj
Calcite | Level 5

Dear All.

 

I am currently coding for Contingent value method (double bounded dichotomous-choice and 1.5 dichotomous-choice)

 

As I am not STATA user and I am not good at using SAS, it is really difficult to translate the below Stata & LIMDEP coding to SAS coding.

 

Would you help me to change from STATA and LIMDEP code to SAS code?

 

Your help is greatly appreciated. Have a good day!

 

 

 

 

 

* Version: September 2013
* Alejandro Lopez-Feldman
* Division de Economia
* Centro de Investigacion y docencia economicas, CIDE
* lopezfeldman@gmail.com
* This is called by doubleb.ado

program doubleb_ll
	version 10.1
	args lnf xb sig
	tempvar bid1 bid2 nn ny yn yy check
	gen double `bid1'= $ML_y1 
	gen double `bid2'= $ML_y2
	gen  `yy' = $ML_y3 * $ML_y4  
	gen `nn' = 0 
	qui replace `nn' =1 if $ML_y3==0  & $ML_y4==0   
	gen `ny' = 0 
	qui replace `ny' = 1 if $ML_y3==0  & $ML_y4==1 
	gen `yn' = 0 
	qui replace `yn' = 1 if $ML_y3==1  & $ML_y4==0 

	qui replace `lnf' = ln(normal(((`xb'-`bid2')/(`sig')))) if `yy' ==1
	qui replace `lnf' = ln(1-normal(((`xb'-`bid2')/(`sig')))) if `nn' ==1
	qui replace `lnf' = ln(normal(((`xb'-`bid1')/(`sig')))-normal(((`xb'-`bid2')/(`sig')))) if `yn' ==1
	qui replace `lnf' = ln(normal(((`xb'-`bid2')/(`sig')))-normal(((`xb'-`bid1')/(`sig')))) if `ny' ==1	

end

Retreived from : http://fmwww.bc.edu/repec/bocode/d/doubleb_ll.ado

 

I have been working with one and one-half bound ditchotomouse cvm 
> and have problem to get computer output using limdep program. The 
> input code and output and error massages are like followings;
> 
> name list; bh=one, ubid; bl=one, lbid$
> PROBIT ; lhs=res1
> ;rhs=one , bid1$
> name list; bh=one, ubid; bl=one, lbid$
> maximize ;label= B1, B2
>  ;start=b
>  ;maxit=100
>  ;fcn=
>  PBH=PHI(-dot(bh))|
>  PBL=PHI(-dot(bl))|
>  yY*LOG(1-PBH)
>  +YN*LOG(PBH-PBL)
>  +nN*LOG(PBL)$
> 
> Any advice would be
> appreciated.
> Thanks

Retrieved from : https://mailman.sydney.edu.au/pipermail/limdep/2006-July/000096.html

1 REPLY 1
Patrick
Opal | Level 21

@hmj 

If you're lucky the someone got coding skills in at least one of the languages used in your post. 

Given that this is not that much code and also doesn't look like it's doing that much: Why don't  you post what you have and what you need in the SAS Analytics forum here. May be just forget about the code but provide sample data and formulate the coding problem you need help with. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 909 views
  • 0 likes
  • 2 in conversation