Download htopen using htexample, replace

Document related concepts
no text concepts found
Transcript
Generación de resultados
en formato HTML
mediante Stata
Llorenç Quintó
Jornadas de Consultoría Estadística y Software II
El centro de investigación de:
Esquema de la presentación
•
•
•
•
•
Motivaciones
Nuestra contribución
Implementación
Programas disponibles
Programas en construcción
El centro de investigación de:
Motivaciones
El centro de investigación de:
• Soporte metodológico
• Soporte estadístico
• Elaboración de informes
• Errores transcripción y cambios
en los datos
• Tablas pre-formateadas y figuras
• simple
• sin software adicional
• Reproducibilidad
• Actualización
Nuestra contribución
El centro de investigación de:
Nuestra contribución
· net install dm0066
· help ht
El centro de investigación de:
Implementación
El centro de investigación de:
• Texto plano para elaboración
páginas web
• <etiqueta> Contenido </etiqueta>
• <etiqueta> Ubicación </etiqueta>
• La página web contiene sólo
texto mientras que recae en el
navegador web la tarea de unir
todos los elementos y visualizar
la página final
Implementación
El centro de investigación de:
Implementación
·
·
·
·
·
·
·
El centro de investigación de:
tempname handle
file open `handle' using htexample.html, text write replace
file write `handle' "<h1> Statistical Analysis </h1>"
sysuse auto
sum mpg
file write `handle' "Mean for mpg is `: di %8.2f r(mean)'"
file close `handle'
Ver resultado
Programas disponibles
El centro de investigación de:
htopen using filename [ , options ]
htclose [ , options ]
htput expression
·
·
·
·
·
·
htopen using htexample, replace
htput <h1> Statistical Analysis </h1>
sysuse auto
sum mpg
htput Mean for mpg is `: di %8.2f r(mean)'
htclose
Programas disponibles
El centro de investigación de:
htlog stata_cmd
·
·
·
·
·
·
htopen using htexample, replace
htput <h1> Statistical Analysis </h1>
sysuse auto
htput <h2> Table 1 </h2>
htlog sum price length weight mpg rep78 trunk
htclose
Ver resultado
Programas disponibles
El centro de investigación de:
htlist [ varlist ] [if] [in] [ , options ]
·
·
·
·
·
htopen using htexample, replace
htput <h2> List of first records </h2>
sysuse auto
htlist in 1/10
htclose
Ver resultado
Programas disponibles
El centro de investigación de:
htsummary varname1 [ varname2 ] [if] [in] [ , options ]
· htopen using htexample, replace
· htput <h1> Statistical Analysis </h1>
· sysuse auto
· recode mpg (min/20 = 0 Low) (20/25 = 1 Medium)
(25/max = 2 High), gen(mympg)
· label var mympg "Mileage (level)"
· format price length weight mpg rep78 trunk %8.2f
·
·
·
·
·
·
·
·
htput <h2> Table
htsummary price,
htsummary length
htsummary weight
htsummary mympg,
htsummary rep78
htsummary trunk,
htclose
1 </h2>
head
freq
close
Ver resultado
Programas disponibles
El centro de investigación de:
htsummary varname1 [ varname2 ] [if] [in] [ , options ]
· htopen using htexample, replace
· htput <h1> Statistical Analysis </h1>
· sysuse auto
· recode mpg (min/20 = 0 Low) (20/25 = 1 Medium)
(25/max = 2 High), gen(mympg)
· label var mympg "Mileage (level)"
· format price length weight mpg rep78 trunk %8.2f
·
·
·
·
·
·
·
·
htput <h2> Table 1 </h2>
htsummary price foreign, head
htsummary length foreign
htsummary weight foreign
htsummary mympg foreign, freq
htsummary rep78 foreign
htsummary trunk foreign, close
htclose
Ver resultado
Programas disponibles
El centro de investigación de:
htsummary varname1 [ varname2 ] [if] [in] [ , options ]
· htopen using htexample, replace
· htput <h1> Statistical Analysis </h1>
· sysuse auto
· recode mpg (min/20 = 0 Low) (20/25 = 1 Medium)
(25/max = 2 High), gen(mympg)
· label var mympg "Mileage (level)"
· format price length weight mpg rep78 trunk %8.2f
·
·
·
·
·
·
·
·
htput <h2> Table 1 </h2>
htsummary price foreign, head test
htsummary length foreign, test
htsummary weight foreign, test
htsummary mympg foreign, freq rowtotal row test
htsummary rep78 foreign, median test
htsummary trunk foreign, close log test Ver resultado
htclose
Programas en construcción
El centro de investigación de:
htreg, command(stata_cmd) [ options ]
· htopen using htexample, replace
· htput <h2> Table 3 (logistic regression models for Car type) </h2>
· htreg, command(for var length weight i.mympg rep78 trunk: logistic
foreign price X) n coef(Odds Ratio) log(trunk)
· htclose
Ver resultado
Programas en construcción
El centro de investigación de:
htreg, command(stata_cmd) [ options ]
· htopen using htexample, replace
· htput <h2> Table 4 (full model) </h2>
· htreg, command(logistic foreign price length weight i.mympg rep78
trunk) n coef(Odds Ratio) log(trunk) inc(price(1000)) bdif(mympg)
· htclose
Ver resultado
Programas en construcción
El centro de investigación de:
htreg, command(stata_cmd) [ options ]
· htopen using htexample, replace
· htput <h2> Table 5 (stepwise estimation) </h2>
· htreg, command(xi: stepwise, pr(.10) lockterm1: logistic foreign
price length weight (i.mympg) rep78 trunk) n coef(Odds Ratio)
log(trunk) inc(price(1000)) bdif(mympg)
· htclose
Ver resultado
Programas en construcción
htdo y sus utilidades
• htdonew
• htdoedit
• htdodel
htdosetup
• htdomaster
• htdoclean
• htdoupdate
• htreggraph
El centro de investigación de:
El centro de investigación de: