How do I get the asdoc output table to show both the variable labels and value labels in Stata? - label

I'm trying to make a table using asdoc that will include both the value labels and the variable labels in the output. When I run the following line of code in Stata
asdoc list progname progtype progterm publicprivate cohortsize grereq, label
I get this in the console (no variable labels):
But in the word doc, it comes out looking like this (has variable labels but no value labels in the table cells):
How do I get both the variable and value labels in the table?

The last update of asdoc was on April 10, 2021. I announced the following in that update.
It is now almost three years that I have been developing asdoc and constantly adding features to it. With the addition of _docx and xl() classes to Stata, it is high time to add support for native docx and xlsx output to asdoc. Also, given that there exists a significant number of LaTeX users, asdoc should be able to create LaTeX documents. It gives me immense pleasure to announce asdocx that is not only more flexible in making customized tables, but also creates documents in native docx, xlsx, html, and tex formats. If you have enjoyed and find asdoc useful, please consider buying a copy of asdocx to support its development. Details related to asdocx can be found on this page.
I am still committed to fixing bugs / issues in asdoc. However, I think it makes more sense to me to add features to asdocx than asdoc, given that asdocx supports all latest developments in Word, Excel and LaTeX.
The requested feature is already available in asdocx. See the following example.
sysuse nlsw88
asdocx list industry age race married grade south in 1/20, replace label

Related

Kofax Seperate Main Invoice from Supporting Document without using Seperator sheet

When a batch gets created documents should get separated automatically without using separator sheet or Barcode separator.
How can I classify documents for Invoice and supporting document.
In our project we get many invoices with supporting document so the scanning person has to insert the separator sheets manually, so to avoid this we want to automatically classify the supporting documents.
In general the concept would be that you would enable separation in the project and then train your classes with examples to be used for the layout or content classifiers.
However, as I'm sure you've seen, the obstacle with invoices is that they are different enough between vendors that it would not reliably classify all to an Invoice class. Similarly with "Supporting Documents" which are likely to be very different from each other, so unfortunately there isn't a completely easy answer without separator sheets (or barcode stickers affixed to supporting docs).
What you might want to do is write code in the one of the separation events like Document_AfterSeparate event. Despite the name, the document has not yet been split at this point, but the classifiers have run. See Scripting Help topic "Server Script Events Sequence > Document Separation > Standard Document Separation" for more detail. Setting the SplitPage property on the CDocPage (pXDoc.CDoc.Pages.ItemByIndex(lPage).SplitPage) will allow you to use your own logic to determine which pages to separate.
For example if you know that you will always have single page invoices, you can split on the first page and classify accordingly. Or you can try to search for something that indicates the end of the invoice like "Total" or other characteristics. There is an example of how you can use locators to help separation in the Scripting Help topic "Script Samples > Use Locator Results for Standard Document Separation". The example uses a Barcode Locator, but the same concept works if you wanted to try it with a Format Locator or anything else.
Without Separator sheets you will need a smart classification software like Kofax Transformation Module (KTM). Its kind of expensive. you will need to verify the cost saving and ROI.

How to disable dates before today in DatePicker tool in Windows Phone? [duplicate]

First of, is there any real documentation of the toolkit ? What I would like is to specify a range of selectable dates. For example I don't want to display dates before today. If the user select a start date of Jan. 27th 2012, I want to allow only dates after these for the return date
Documentation is a little bit sparse for the toolkit - your best bet is to look in the source of the sample app but they don't cover all the scenarios.
The default control doesn't seem to support a minimum or maximum value for the selected date, but if you download the source you should be able to modify it according to your needs. The layout of the source is pretty straightforward and you should be able to find an acceptable place to add the code, the only thing you need to decide is how you handle it from a UI perspective. In my opinion, you are better off handling the range check once the control returns - if it is an invalid date, pop up a message and re-show the control.
I've found that in the absence of documentation, the WindowsPhoneGeek blog (in this specific case see link here) usually does a good job of explaining the Silverlight Toolkit components in their various articles.
These articles can be a great help when following ZombieSheep's advice of taking a look at the toolkit sample code.

Limit date range in a DatePicker

First of, is there any real documentation of the toolkit ? What I would like is to specify a range of selectable dates. For example I don't want to display dates before today. If the user select a start date of Jan. 27th 2012, I want to allow only dates after these for the return date
Documentation is a little bit sparse for the toolkit - your best bet is to look in the source of the sample app but they don't cover all the scenarios.
The default control doesn't seem to support a minimum or maximum value for the selected date, but if you download the source you should be able to modify it according to your needs. The layout of the source is pretty straightforward and you should be able to find an acceptable place to add the code, the only thing you need to decide is how you handle it from a UI perspective. In my opinion, you are better off handling the range check once the control returns - if it is an invalid date, pop up a message and re-show the control.
I've found that in the absence of documentation, the WindowsPhoneGeek blog (in this specific case see link here) usually does a good job of explaining the Silverlight Toolkit components in their various articles.
These articles can be a great help when following ZombieSheep's advice of taking a look at the toolkit sample code.

Import data from URL

The St. Louis Federal Reserve Bank has a great set of data available on a variety of their web pages, such as:
http://research.stlouisfed.org/fred2/series/OILPRICE/downloaddata?cid=32217
http://www.federalreserve.gov/releases/h10/summary/default.htm
http://research.stlouisfed.org/fred2/series/DGS20
The data sets get updated, some as often as daily. I tend to have an interest in the daily data (see the above settings on the URLS)
I'd like to import these kinds of price or rate data streams (accessible as CSV or Excel files at the above URLs) directly into Mathematica.
I've looked at the documentation on Importing[] but I find scant documentation (actually none) on how to go about something like this.
It looks like I need to navigate to the pages, send some data to select specific files and formats, trigger the download, then access the downloaded data from my own machine. Even better if I could access the data directly from the sites.
I had hoped Wolfram Alpha might make this sort thing easy, but I haven't had any success.
FinancialData[] would seem natural for this sort of thing, but I don't see anyway to do it. Financial data has lots of features, but I don't see a way yo get this sort of thing.
Does anyone have any experience with this or can someone point me in the right direction?
You can Import directly from a URL. For example, the data from federalreserve.gov can be obtained and visualized as follows.
url = "http://www.federalreserve.gov/datadownload/Output.aspx?";
url = url<>"rel=H10&series=a660e724c705cea4b7bd1d1b85789862&lastObs=&";
url = url<>"from=&to=&filetype=csv&label=include&layout=seriescolumn";
data = Import[url, "CSV"];
DateListPlot[data[[7 ;;]], Joined -> True]
I broke up url for convenience, since it's so long. I had to examine the contents of data before I knew exactly how to plot it - a step that is typically necessary. I'm sure that the data from stlouisfed.org can be obtained in a similar way, but it requires the use of an API with key to access it.
As Mark said, you can get the data directly from a URL. Your oil data can be imported from a different URL than you had:
http://research.stlouisfed.org/fred2/data/OILPRICE.txt
With that URL, you can do this:
oil = Import["http://research.stlouisfed.org/fred2/data/OILPRICE.txt",
"Table", "HeaderLines" -> 12, "DateStringFormat" -> {"Year", "Month", "Day"}];
DateListPlot[oil, Joined -> True, PlotRange -> All]
Note that "HeaderLines"->12 option strips off the header text in the first 12 lines (you have to count the header lines to know how many to remove). I've also specified the date format.
To find that URL, do as you did before, but click on a data series and then choose View Data from the menu on the left when you see the chart.
The documentation has a short example on extracting data out of a webpage:
http://reference.wolfram.com/mathematica/howto/CleanUpDataImportedFromAWebsite.html
Of course, what actually needs to be done will vary significantly from page to page.
discussion on how to do this with your API key here:
http://library.wolfram.com/infocenter/MathSource/7583/
the function is based on the API documentation. I haven't looked at the code for a couple of years and from memory I put it together rather quickly but I have used it regularly for over 2 years without problems. Here is an example for monthly non seasonally adjusted retail sales from early 1992 to now:
wolfram alpha also uses FRED data so you could use that as an alternative to direct import but it is more tricky to get the query right. I prefer to use FRED directly. Also from memory the data is only available on alpha the day after the release, which is not what you would typically want.

Report Design Templates

We are using DevExpress XtraReports 2009v3.3 and although I can achieve what I want through various formatting objects in code, there must be a (better/less painless/maintainable/visual) way of achieving what I require...
I need to produce a report, designed to end-user 'look & feel'. We have many companies which use our software and they all require different design schema's/templates for their reports. For example - a single report, depending on who logs on (we know what company they belong to) apply the template the report should use.
As an example, some of the requirements (per end-user/company) include:
their own logo (positioned in the correct place),
Margins being of specific size
their own fonts (or font choice)
alternating colours schemes
Specific rows / columns being particular colours (both permanently and based on value)
Formatting of values, for example a european user would get euro, a uk user gets pounds on certain columns/cells/rows.
I know there is an End-User Report Designer, however this isn't what we require - I must create the schema/template design for a report then apply it at runtime.
Also using save/load layout for multiple repx files isn't the best solution as a change to the report would cause a lot of extra work as you would have to update each repx template file.
It is possible to create different reports and save it to the repx format via XtraReport.SaveLayout method and use these repx files as template.
Similar but different question
I asked dev express and they basically said there isn't any 'layout abstraction' that would do what I require.

Resources