当前位置:文档之家› NBER WORKING PAPER SERIES PHARMACEUTICAL EMBODIED TECHNICAL PROGRESS, LONGEVITY, AND QUALIT

NBER WORKING PAPER SERIES PHARMACEUTICAL EMBODIED TECHNICAL PROGRESS, LONGEVITY, AND QUALIT

NBER WORKING PAPER SERIES PHARMACEUTICAL EMBODIED TECHNICAL PROGRESS, LONGEVITY, AND QUALIT
NBER WORKING PAPER SERIES PHARMACEUTICAL EMBODIED TECHNICAL PROGRESS, LONGEVITY, AND QUALIT

NBER WORKING PAPER SERIES

PHARMACEUTICAL EMBODIED TECHNICAL PROGRESS,

LONGEVITY, AND QUALITY OF LIFE:

DRUGS AS “EQUIPMENT FOR YOUR HEALTH”

Frank R. Lichtenberg

Suchin Virabhak

Working Paper9351

https://www.doczj.com/doc/1114157670.html,/papers/w9351

NATIONAL BUREAU OF ECONOMIC RESEARCH

1050 Massachusetts Avenue

Cambridge, MA 02138

November 2002

The views expressed herein are those of the authors and not necessarily those of the National Bureau of Economic Research.

? 2002 by Frank R. Lichtenberg and Suchin Virabhak. All rights reserved. Short sections of text, not to exceed two paragraphs, may be quoted without explicit permission provided that full credit, including ?notice, is given to the source.

Pharmaceutical-embodied technical progress, longevity, and quality of life:

drugs as “equipment for your health”

Frank R. Lichtenberg and Suchin Virabhak

NBER Working Paper No. 9351

November 2002

JEL No. I12, L65, O3

ABSTRACT

Several econometric studies have concluded that technical progress embodied in equipment is a major source of manufacturing productivity growth. Other research has suggested that, over the long run, growth in the U.S. economy’s “health output” has been at least as large as the growth in non-health goods and services. One important input in the production of health—pharmaceuticals—is even more R&D- intensive than equipment.

In this paper we test the pharmaceutical-embodied technical progress hypothesis—the hypothesis that newer drugs increase the length and quality of life—and estimate the rate of progress. To do this, we estimate health production functions, in which the dependent variables are various indicators of post-treatment health status (such as survival, perceived health status, and presence of physical or cognitive limitations), and the regressors include drug vintage (the year in which the FDA first approved a drug’s active ingredient(s)) and indicators of pre-treatment health status. We estimate these relationships using extremely disaggregated—prescription- level—cross-sectional data derived primarily from the 1997 Medical Expenditure Panel Survey.

We find that people who used newer drugs had better post-treatment health than people using older drugs for the same condition, controlling for pre-treatment health, age, sex, race, marital status, education, income, and insurance coverage: they were more likely to survive, their perceived health status was higher, and they experienced fewer activity, social, and physical limitations. The estimated cost of the increase in vintage required to keep a person alive is lower than some estimates of the value of remaining alive for one month. One estimate of the cost of preventing an activity limitation is $1745, and the annual rate of technical progress with respect to activity limitations is 8.4%. People consuming newer drugs tend to experience greater increases (or smaller declines) in physical ability than people consuming older drugs.

Most of the health measures indicate that the effect of drug vintage on health is higher for people with low initial health than it is for people with high initial health. Therefore in contrast to equipment-embodied technical progress, which tends to increase economic inequality, pharmaceutical-embodied technical progress has a tendency to reduce inequality as well as promote economic growth, broadly defined.

Frank R. Lichtenberg Suchin Virabhak

Columbia University Department of Economics

Graduate School of Business Columbia University

726 Uris Hall New York, NY 10027

3022 Broadway sv102@https://www.doczj.com/doc/1114157670.html,

New York, NY 10027

and NBER

frank.lichtenberg@https://www.doczj.com/doc/1114157670.html,

In his seminal 1956 paper, Robert Solow showed that, for sustained economic

growth to occur, technological progress is necessary:

In that paper, Solow assumed that technical progress was exogenous: it descends upon the economy like “manna from heaven,” automatically and regardless of whatever else is

going on in the economy (Jones (1998, 32-3)).

More recent theoretical (“endogenous growth”) models (Romer (1990)) relaxed

this assumption: they have hypothesized that “technical progress is driven by research

and development” ((Jones (1998, 89-90)):

Empirical evidence (e.g. Griliches and Lichtenberg (1984), Lichtenberg and Siegel (199?)) is consistent with the hypothesis that firms and industries that perform more

R&D exhibit higher productivity growth.

Solow and other economists have recognized since the late 1950s that there are

two kinds of technical progress:

disembodied and embodied .

Suppose that agent i in the economy (e.g. a firm or government agency) engages in

research and development. If technical progress is disembodied, another agent (j) can

benefit from agent i’s R&D whether or not he purchases agent i’s products. But if

technical progress is embodied, agent j benefits from agent i’s R&D only if he purchases

agent i’s products. Solow conjectured that most technical progress was embodied. In

one paper (Solow (1962, p. 76)), he assumed that “all technological progress needs to be

‘embodied’ in newly produced capital goods before there can be any effect on output.”

A number of econometric studies have investigated the hypothesis that capital

equipment employed by U.S. manufacturing firms embodies technological change, i.e.

that “each successive vintage of investment is more productive than the last.” Equipment is expected to embody significant technical progress due to the relatively high R&D-intensity of equipment manufacturers. According to the National Science Foundation, the R&D-intensity of machinery and equipment manufacturing is about 50% higher than the R&D-intensity of manufacturing in general, and 78% higher than the R&D intensity

of all industries.

One method that has been used to test the equipment-embodied technical change hypothesis is to estimate manufacturing production functions, including (mean) vintage

of equipment as well as quantities of capital and labor. Bahk and Gort (1993) argued that “we can take due account of the effect of vintage by measuring the average vintage of the stock” (p. 565). Similarly, Sakellaris and Wilson (2000) stated that “a standard production function estimation (in logs) provides an estimate of embodied technical change by dividing the coefficient on average age [of equipment] by the coefficient on capital stock” (capital’s share in total cost).

These studies have concluded that technical progress embodied in equipment is a major source of manufacturing productivity growth. Hulten (1992) found that as much as 20 percent (and perhaps more) of the BLS total-factor-productivity change (in manufacturing) can be directly associated with embodiment—the higher productivity of new capital than old capital. For equipment used in U.S. manufacturing, best-practice technology may be as much as 23 percent above the average level of technical efficiency. Bahk and Gort (1993) concluded that “Industrywide learning appears to be uniquely related to embodied technical change of physical capital. Once due account is taken of the latter variable, residual industrywide learning [disembodied technical change] disappears as a significant explanatory variable” (p. 579). And Sakellaris and Wilson (2000) estimate that “each vintage is about 12 percent more productive than the previous year’s vintage (in the preferred specification)”, and that equipment-embodied technical change accounted for about two thirds of U.S. manufacturing productivity growth between 1972 and 1996.

Although equipment-embodied technical progress has contributed to U.S. economic growth, it has probably had an undesirable side effect: increasing economic

inequality.1 Bartel and Lichtenberg (1987) presented evidence that reductions in the

mean age of equipment reduce the relative demand for, and wages of, less-educated

workers. Support for the “skill-biased technical change” hypothesis has been provided

by numerous other studies.

Although virtually all previous empirical studies of embodied technical progress have focused on equipment used in manufacturing, embodied technical progress may also

be an important source of economic growth in another sector of the economy: health care.

Recent research has suggested that, over the long run, growth in the U.S. economy’s

“health output” has been at least as large as the growth in non -health goods and services.2

Between 1900 and 1997, life expectancy at birth increased from 49.2 years to 76.5 years

Anderson (1999)). Nordhaus (2002) estimated that, “to a first approximation, the

economic value of increases in longevity over the twentieth century is about as large as

the value of measured growth in non -health goods and services”. Moreover, there is

evidence that the quality as well as the length of life of life have increased. According to

a new study, which looked at a sample of 19,000 Americans age 65 and older, the

chances that elderly Americans will be devastated by chronic disabilities like stroke and

dementia have declined sharply. The number of older people who become severely

disabled has been declining gradually for more than a decade, but the decline became

much sharper at the end of the 1990's.3 1 According to a recent article, “For 30 years the gap between the richest Americans and everyone else has

been growing so much that the level of inequality is higher than in any other industrialized nation….many

economists [have] come to see inequality as a basic feature of the new high-tech economic scene.”

(“Grounded by an income gap,” New York Times , Dec. 15, 2001.) 2 Evidentl y, officials at the United Nations feel that per capita GDP growth is an incomplete measure of

economic growth, broadly defined: they publish the “human development index,” which is an (unweighted)

average of three indexes: a life expectancy index, an education index, and an index of per capita GDP. 3 Scientists at the National Institute on Aging, which sponsored the study, said the decline probably resulted

from a variety of factors, including more widespread knowledge of the benefits of diet and exercise, fewer

people smoking, new drugs for heart problems and other illnesses, and advances in eye surgery. Advances

in prescription drugs and medical technology have also contributed to the decline. “Decrease in Chronic

Illness Bodes Well for Medicare Costs,” New York Times

, May 8, 2001

Thus health output appears to be increasing at least as fast as conventional output. Moreover, one important input in the production of health—pharmaceuticals—is even more R&D-intensive than equipment. According to the NSF, the R&D intensity of drugs and medicines manufacturing is 74% higher than the R&D intensity of machinery and equipment manufacturing (Figure 1). Therefore, it is quite plausible that there is also a high rate of pharmaceutical-embodied technical progress.

The objective of this paper is to test the pharmaceutical-embodied technical progress hypothesis—the hypothesis that newer drugs increase the length and quality of life—and to estimate the rate of progress. In one respect, the approach we take is similar to that used in previous studies of manufacturing: we estimate production functions that include vintage. But our methodology differs in a number of ways. We estimate health production functions, in which the dependent variables are various indicators of health status, such as presence of physical or cognitive limitations. We estimate these relationships using extremely disaggregated—prescription-level—cross-sectional data derived primarily from the 1997 Medical Expenditure Panel Survey. And we define vintage as the year in which the Food and Drug Administration (FDA) first approved a drug’s active ingredient(s).

Theoretical Framework

The simplest model one might estimate to determine the effect of drug vintage on post-treatment health is

H POST = b0 + b1 V + b2 Z + u (1)

where:

H POST is a measure of a person’s post-treatment health status

V is the vintage (FDA approval year) of the drug(s) consumed by the person

during a period

Z are other potential determinants of H POST that may be correlated with V (e.g.

medical condition, age, sex, and education)

u is a disturbance

For several reasons, however, the consistency and efficiency of estimates of this effect may be improved by extending eq. (1) to include pre-treatment health status:

H POST = b0 + b1 V + b2 Z + b3 H PRE + u (2) where:

H PRE is a measure of a person’s pre-treatment health status, i.e. her status at the

beginning of the period

We will estimate both models. Estimation of eq. (2) will reveal the effect of vintage on post-treatment health status, conditional on pre-treatment health status.4 The first reason to control for H PRE is that many of the health indicators that we will analyze are fairly subjective: they are responses to questions such as “do you have difficulty walking?,” or “do you suffer from cognitive limitations?”. There may be significant differences in the way people whose “true” health is the same respond to such questions. But as long as these differences remain the same in the pre- and post-treatment health surveys, they won’t affect our estimates.

The second reason is that H POST may depend on the vintage of drugs consumed in previous periods as well as the period of observation. Suppose that H POST = f(V, V-1, V-,…). If the coefficients on V decay geometrically with respect to time, one may express 2

H POST as a linear function of current V and its own lagged value (H PRE). Under these assumptions, b1 may be interpreted as the short-run effect of V on health, and (b1 / (1 – b3)) may be interpreted as the long-run effect.

The third reason to control for H PRE is that assignment of drugs to individuals is not random. Moreover, a simple but plausible theory of how drugs are assigned to people, which we sketch below, suggests that V may be (negatively) correlated with

H PRE. If this is the case, estimates of eq. (1) will yield estimates of the effect of drug vintage on post-treatment health that are biased downward5.

4 If age affects the rate of depreciation of health as well as the level of health (e.g., health declines more rapidly among the elderly), then age should reduce H POST, conditional on H PRE.

5 Another concern is the issue of access to drugs. Should this be restricted, we would expect people with access to newer drugs to have better outcomes, hence rendering the estimates from our proposed model to be potentially misleading. Although it remains unobserved, studies have shown wide variation in health care usage exists among apparently comparable populations living in neighboring communities. For details on small area analysis, refer for instance to Wennberg, John E. et al (1980).

Suppose that a person’s (post-treatment) utility function is:

U = U(H POST, Y – p V V) (3)

where:

Y is the person’s gross income (assumed to be exogenous)

p V (p V > 0) is the “price of vintage”, i.e. the difference in price between a drug of vintage t+1 and a drug of vintage t.6 Hence (Y – p V V) is the person’s “residual

income”, i.e. income net of expenditure on drug vintage.

Further suppose that the (post-treatment) health production function is of the form

H POST = H POST(V, H PRE) (4)

where:

H PRE is a measure of a person’s pre-treatment health status (also assumed to be

exogenous).

Assume that the partial derivatives of H POST with respect to both V and H PRE are positive: increases in pre-treatment health and in drug vintage both increase post-treatment health.

Eq. (1) can be regarded as a linear version of eq. (4), in which H PRE is included in the disturbance.

Substituting (4) into (3),

U = U(H POST(V, H PRE), Y – p V V) (5)

Using newer drugs (increasing V) affects utility in two opposite ways: it increases U by increasing H POST, but reduces utility by reducing residual income (Y – p V V). A utility-maximizing consumer chooses V to balance these two effects.

We now make one further assumption about the health production function (4): a “negative interaction” between V and H PRE ((?2 H POST / ? V ? H PRE) < 0), i.e. we assume that the marginal productivity of increasing V is higher for people with poor initial health (low H PRE). (Figure 2) As a rule, increases in the quantity and quality of medical care are probably more valuable to people in poor initial health than they are to people in

6 We will present evidence about p

below.

V

excellent initial health. We will present empirical evidence that provides strong support for this negative interaction.

Since people with low education and income are more likely to be in poor initial health than people with high education and income, pharmaceutical-embodied technical progress may be biased towards the less-educated.7 If so, it tends to reduce inequality as it contributes to economic growth.8

These assumptions imply that (for given Y), equilibrium V is inversely related to H PRE: individuals in poor initial health will tend to use newer drugs than people in excellent initial health. This is why b1 from equation (1) may underestimate the effect of V on H POST. Suppose that the true post-treatment health production function is a linear version of eq. (4):

H POST = β0 + β1 V + β2 Z + β3 H PRE + u (6)

Then plim(b1) = β1 + β3βPRE.V, where βPRE.V is the slope coefficient from the simple “auxiliary” regression of H PRE on V. Since we hypothesize that β3 > 0 and βPRE.V < 0, plim(b1) < β1.

Fortunately, we have data on H PRE as well as on H POST and V, so we can estimate eq. (5), i.e. we can control for pre-treatment health. In fact, we can extend and g eneralize the model as follows:

H POST = β0 + β1 V + β2 Z + β3 H PRE + β4 (V * H PRE) + u (7)

According to the “negative interaction” hypothesis discussed above, inclusion of the interaction term (V * H PRE) is appropriate.

We have argued that controlling for initial health status affords a better representation of the health production function than one without. However, the health

7 Provided that the less-educated have access to new drugs. Lleras-Muney and Lichtenberg (2002) find that less-educated people use older drugs than more-educated people, but the difference in mean age of drugs is very small. The Medicaid program has been the main source of access to new (and old) drugs by less-educated people for the last 30 years.

8 Inequality in household income increased during the period 1970-95: the share of U.S. aggregate income received by the top 20% of households increased from 43.3% in 1970 to 48.7% in 1995; the share received by the top 5% increased from 16.6% to 21.0%. In contrast, inequality in longevity declined: t he coefficient of variation of mean age at death declined by about 7%, from 26.6 to 24.7. (Infant deaths are excluded from these calculations.) In general, the outward shift of the age-at-death distribution was larger at the left (at young ages) than it was at the right.

production function in equation (7) still fails to account for health shocks that may occur during the interim between the initial health and post-treatment health ‘snapshots’. Although health shock events are unobservable, we have reason to believe that including treatment responses could help capture their impact. In other words, by incorporating health utilization measures such as the quantity of prescription drugs, physician visits, and inpatient discharges into our regression, we could, to some extent, account for adverse health shocks9. With this interpretation, we would expect a negative relationship between health utilizati on and post treatment health status – a person who encounters adverse health shocks would receive more treatment. Under this specification, the health production function in equation (4) takes the form:

H POST = H POST(V, H PRE, Health Shocks) (4’)

Further, using health utilization as a proxy for shocks and assuming a linear production function, we modify equation (6) to give:

H POST = β0 + β1 V + β2 Z + β3 H PRE

+ β4 Prescription + β5 Physician + β6 Hospital + u (8)

where:

Prescription refers to the number of prescriptions

Physician is the number of physician visits

Hospital is the number of inpatient admissions

β4, β5, and β6 are postulated to be negative

The model specified in equation (8) poses an additional estimation concern for the drug vintage coefficient. If the quality of drugs affects health status, then it must certainly affect the extent to which a person utilizes other health treatments. This implies that (for any given post-treatment health status), equilibrium V is inversely related to each health utilization variable: individuals who use newer drugs would also tend to need

9 Notice that our proposed health utilization variables represent quantitative rather than qualitative health ‘consumption’ (unlike our drug vintage coefficient), which should therefore effectively measure the degree of adverse health events.

quantitatively less treatment in the form of drugs, physician visits and/or inpatient care10. For ease of exposition, let’s assume a composite variable denoting health utilization, UTIL, with respective slope coefficient, βUTIL. If V and UTIL are negatively related, we expect b1 from equation (1) may ‘overestimate’ the effect of V on H POST11: plim(b1) = β1 + βUTILβUTIL.V, where βUTIL.V is the slope coefficient from the “auxiliary” regression of UTIL on V. The first term, β1 can be interpreted as the direct effect of V on H POST,while the expression, βUTILβUTIL.V measures the indirect impact of V on H POST via UTIL. Since we hypothesize that βUTIL < 0 and βUTIL.V < 0, plim(b1) > β1. In short, a priori, we anticipate a lower drug vintage coefficient when we include health utilization. However, this does not necessarily imply that the overall impact of V on H POST is overestimated when utilization is excluded. Adjusting for utilization simply decomposes drug vintage into its direct and indirect effects.

Data

In order to estimate eq. (6), and determine the effect of drug vintage on post-treatment health, conditional on pre-treatment health and a large number of covariates, we will use data from the household component of the 1997 Medical Expenditure Panel Survey (MEPS). The household component collected data on a sample of families

and individuals, drawn from a nationally representative subsample of households, which permits gen eralization to the entire civilian noninstitutionalized population of the United States. The objective was to produce annual estimates for a variety of measures of health status, health insurance coverage, health care use and expenditures, and sources of payment for health services. The panel design of the survey, which features several rounds of interviewing, makes it possible to determine how changes in respondents' health status, income, employment, eligibility for public and private insurance coverage, use of services, and payment for care are related.

The 1997 MEPS household component collected data on 34,551 people. Each person was interviewed a number of times, and data on the person’s use of medical

10 There is empirical support for this claim. Using 1996 Medical Expenditure Panel Survey, Lichtenberg (2001) finds evidence that the replacement of older by newer drugs results in reductions in mortality, morbidity, and total medical expenditure.

11 For simplicity, we ignore the interaction between V and H

that was previously discussed.

pre

services throughout the year (including data on each of their 234,532 prescribed medicines) were collected.12

To measure pre-treatment health status (H PRE) and covariates (Z), we use data collected at the end of round 3 for Panel 1 and round 1 for Panel 2. To measure post-treatment health status (H POST), we use data collected at the end of round 5 for Panel 1 and round 3 for Panel 2. To measure drug vintage V (and other drug attributes, i.e. medical condition and price), we use data on all of the prescribed medicine events that occurred during rounds 4 and 5 for Panel 1 and rounds 2 and 3 for Panel 2. The time-line of health interviews and prescribed medicine events is depicted in Figure 3.

Health status measures. Responses to the following questions about health status were obtained at both interviews:

? Perceived health status (excellent, very good, good, fair, poor)

? Any limitation work/housework/school? (yes, no)

? Any social limitations? (yes, no)

? Any cognitive limitations? (yes, no)

? Any limitation in physical functioning? (yes, no)

? Difficulty lifting 10 pounds? (no difficulty, some difficulty, a lot of difficulty, unable to do)

? Difficulty walking up 10 steps? (no difficulty, some difficulty, a lot of difficulty, unable to do, completely unable to walk)

? Difficulty walking 3 blocks? (no difficulty, some difficulty, a lot of difficulty, unable to do)

? Difficulty walking a mile? (no difficulty, some difficulty, a lot of difficulty, unable to do)

? Difficulty standing 20 minutes? (no difficulty, some difficulty, a lot of difficulty, unable to do)

? Difficulty ben ding/stooping? (no difficulty, some difficulty, a lot of difficulty, unable to do)

? Difficulty reaching overhead? (no difficulty, some difficulty, a lot of difficulty, unable to do)

? Difficulty using fingers to grasp? (no difficulty, some difficulty, a lot of difficulty, unable to do)

12 Average number of rx’s per person (including people with zero rx’s): 6.8. Average number of rx’s per person (excluding people with zero rx’s): 11.4. 41% of people had zero rx’s.

We recoded all of our health measures to take the value 0 for the worst health outcome (“zero health output”) and the value 1 for the best health outcome (“maximum health output”). Using the perceived health status measure and a mortality indicator (whether the person was alive at the time of the second interview), we constructed a composite quality-of-life indicator: (1=excellent health, 0.8=very good health, 0.6=good health,

0.4=fair health, 0.2=poor health, 0=dead). For the difficulty measures, we compute the average across all eight indicators and name the composite, ‘mean level of difficulty’13, 14.

Drug information. For each prescription obtained between the two interviews, we extracted the following information from the 1997 MEPS Prescribed Medicine Events file (HC-016A): the National Drug Code (NDC), the 3-digit ICD9 diagnosis for which the drug was prescribed, and expenditure (by all payers) for the prescription. We used the “denorm” table in Multum’s Lexicon to identify the active ingredients contained in each NDC product. In September 2000 there were 1830 active ingredients listed in Multum’s Lexicon. The FDA approved 92 new molecular entities during 1998-2000, so there would have been about 1738 active ingredients in 1997. However only 789 of these ingredients were contained in products represented in the 1997 MEPS Prescribed Medicine Events file. To determine the vintages (FDA approval dates) of these ingredients, we used two unpublished files obtained from the FDA. The first is a list of all of the 821 new molecular entities (NMEs) approved during the period 1950-1993. The second is a list of all new drug applications (NDAs) approved during the period 1939-1998. (The first FDA drug approval occurred in 1939.) This list includes both new molecular entities approved and other NDAs approved (new formulations, new manufacturers, etc.). Although the two lists are broadly consistent, there are some discrepancies. Figure 4 shows the number of new molecular entities approved per year,

13 The other health status variables available from the MEPS dataset do not permit us to compute

‘reasonable’ (composite) continuous health status. We employ this strategy exclusively for our ‘mean level of difficulty’ measure. See Wells (1996) for a discussion of the construction of health status variables using survey results.

14 During the interviews, the list of 7questions pertaining to detailed physical activities were asked only to respondents who indicated having limitations in physical functioning. We recoded all respondents with no physical limitation as having ‘no difficulty’ in the set of all detailed physical activities.

as computed from both lists.15 We consider the first list to be more reliable for the 1950-1993 period, since the FDA constructed it for the specific purpose of identifying NMEs approved during the period. We use the second list only to provide data on NMEs approved during 1939-1949 and 1994-1997. We matched Multum active ingredient names to ingredient names contained in FDA new molecular entity approvals.

Only 60 percent (470 / 789) of the ingredients reported in the 1997 MEPS data appeared in the list of NMEs approved during 1939-1997. Ingredients with known FDA approval dates accounted for 69 percent (167,667 / 241,314) of MEPS prescriptions.16 Table 1 lists the top 20 active ingredients, ranked by number of prescriptions, in the 1997 MEPS. The top 20 ingredients (2.5 percent of MEPS ingredients) accounted for almost 30 percent of all MEPS prescriptions. Four of the top ten, and five of the top twenty, ingredients did not appear in the list of NMEs approved during 1939-1997; their vintages are unknown but presumably precede 1939. The average cost of a prescription of unknown vintage is $21.88, and the average cost of a prescription of known (1939-1997) vintage is $41.10. Forty-nine percent of prescriptions for drugs of unknown vintage are generic, compared to 36 percent of prescriptions for drugs of known vintage.

There are several ways of handling the problem of censoring of the vintage distribution of drugs. One way is to simply exclude prescriptions for drugs of unknown vintage. This would not affect the consistency of our estimates, provided that the rate of pharmaceutical-embodied technical progress was the same after 1939 as it was before 1939. It would, however, reduce the precision (efficiency) of our estimates, for two reasons. First, it would reduce the size of the sample by almost a third. Second, and probably more importantly, it would substantially reduce the range (and variance) of vintage. The greater this range, the greater the precision of the estimate of β1 (= δH POST / δV).17

15 We also merged the two lists, by new drug approval number, and calculated the difference in approval years recorded in the two lists. The mean and median differences were both approximately zero, and 98% of the differences were between –2 and +2 years, but there were 5 cases in which the absolute difference exceeded 10 years.

16 These figures treat a prescription for a combination drug—a drug with multiple ingredients—as a prescription for each ingredient. For example, a prescription for a drug containing the two ingredients benzalkonium chloride and tyloxapol is treated as two prescriptions, one for each ingredient.

17 If you seek to identify the effect of X on Y, you want X to vary a lot.

An alternative approach is to include prescriptions for drugs of unknown vintage

in the sample, but replace V by a dummy variable whose value depends on the

ingredient’s location in the vintage distribution. Suppose we divide drugs into two

groups: “new drugs” (drugs whose vintage is nonmissing and greater than a certain value

(e.g., 1970)), and “old drugs” (other drugs, including those of unknown vintage). Let V N

represent the mean vintage of new drugs and V o the mean vintage of old drugs. (We

discuss below how the latter may be computed.) Now define a dummy variable equal to

V N if the drug is a new drug and equal to V o if the drug is an old drug. If we replace V by

this dummy variable in eq. (7), its coefficient is an estimate of the “average annual”

effect of vintage on health.18 This model can also be estimated on the sample excluding

prescriptions with missing vintages.

A third approach is to include prescriptions for drugs of unknown vintage in the

sample, and impute an average vintage value (e.g., V = 1900) when vintage is unknown.

Imputation enables estimation of our original model (eq. (6)), but since the appropriate

value to impute is unknown, we should perform sensitivity analysis by trying alternative

values. We report estimates based on two different imputed values, 1900 and 1920.

To summarize, we will estimate five different versions of the model:

Covariates. All of the models we estimate include one prescription -level covariate—the

diagnosis for which the drug was consumed—and the following person -level covariates:

18 Wald (1940) was apparently the first to propose using this kind of dummy variable as an instrument for a

regressor subject to measurement error. Censoring of vintages may not be the only source of vintage

measurement error. One reason is that there is probably considerable variation in the lag between the time

of drug discovery and the time of FDA approval; the former may be a more appropriate measure of vintage,

but is unobserved. A second is that some drugs (“standard review” drugs) may be very similar to

previously approved (“priority review”) drugs; perhaps the “effective vintage” of standard-review drugs is

the vintage of the preceding priority-review drugs to which they are similar.

Missing-vintage rx’s excluded Missing-vintage rx’s included linear vintage

assume missing V = 1900 assume missing V = 1920 vintage dummy

age, sex, race, education, income, marital status, and indicators of insurance coverage (Medicare, Medicaid, and private insurance). All variables except income are included as classification variables, e.g. there is a separate dummy variable for each diagnosis (over 600 diagnoses) and each year of age and education.

Unit of analysis. The unit of analysis is a prescription19, so the model captures the effect of a change in the vintage of a single prescription on the consumer’s post-treatment health. (To calculate the health effect of changing the average vintage of all of a person’s prescriptions, one would multiply by the number of her prescriptions.) Each observation contains the vintage of the drug20, the diagnosis for which the drug was prescribed, the pre- and post-treatment health status of the person consuming the drug, and person-level covariates. Hence, the model is of the form:

H POST,i = β0 + β1 V ij + β2 Z i + β3 H PRE,i + β4 (V ij * H PRE,i)

+ diagnosis effects + u ij(7)

where V ij denotes the jth prescription consumed by person i.

Estimation issues. Due to the categorical nature of the H POST measures listed above, ideally one would estimate model (7) using an (ordered) probit or similar procedure. Unfortunately, due to the large number of (“nuisance”) parameters in the model (600+ diagnosis effects, 100 age effects, 20 education effects, etc.), the probit estimation procedure often failed to converge. Second, our unit of observation is at the prescription level, allowing individuals with more than one prescription event to have multiple entries. We correct for the correlation across such observations by reporting estimates of eq. (7)

19 Hence, if person A had 10 prescriptions and person B had 5, person A would contribute twice as many observations to the sample. Unweighted estimation at the prescription level is similar to weighted estimation at the person level, where the weight is the person’s number of prescriptions. Since diagnosis can vary across prescriptions for a given individual, it is easier to control for diagnosis at the prescription level than it is at the person level.

20 In principle, it would be desirable to decompose approvals not only according to active ingredients, but to different combinations and dosages as well, as these may affect the efficacy of drugs to some degree. However, this is difficult to implement in practice. Moreover, FDA data indicate that new ingredients are more likely to be significant innovations than new formulations or combinations of existi ng ingredients. Our data reveal that 42% of the new molecular entities (NMEs) approved during 1990-2001 were “priority-review approvals” i.e. considered by the FDA to represent “significant improvement compared to marketed products, in the treatment, diagnosis, or prevention of a disease”. On the other hand, only 14% of non-NME NDAs (including new formulations or combinations) approved were priority-review approvals.

using a random effects model that accounts for clustered standard errors21. For binary dependent variables, this is known as the “linear probability model,” which has certain limitations. We hope to supersede these limitations in the future.

Suppose that H POST,i equals 1 if person i has no limitation in physical functioning post-treatment, and otherwise equals zero. Within the linear probability model framework, β1 is the (short-run) effect of a one-year increase in vintage on the probability of no limitation in physical functioning.22 An estimate of β1 allows us to calculate both (1) the increase in drug cost necessary to achieve a given improvement in post-treatment health, and (2) the rate of pharmaceutical-embodied technical progress.

Let P rx represent the price of a prescription. Then dP rx / dV is the derivative of prescription price with respect to vintage—the slope of the vintage-price profile. β1 = dH POST / dV is the derivative of post-treatment health with respect to vintage—the slope of the vintage-health profile. Hence (dP rx / dV) / β1 = dP rx / dH POST is the cost of the increase in vintage necessary to achieve a given improvement in post-treatment health. For example, if dP rx / dV = $1.50 (prescription cost increases at the rate of $1.50 per year of vintage) and β1 = .00018, then dP rx / dH POST = $1.50 / .00018 = $8433. The increase in vintage required to achieve a .01 increase in the probability of no limitation in physical functioning would increase prescription cost by $84.33.23

The percentage change in the probability of no limitation from a one-year increase in vintage is β1 / mean (H POST). For example, if β1 = .00018 and mean (H POST) = .671, the percentage change in probability from a one-year increase in vintage is .00018 /

21 In addition, we attempted the alternative of weighting each observation by the inverse of the number of prescriptions received by that individual – the estimates generally showed a lower standard error, and remained significant.

22 Assuming for simplicity that there is no interaction effect (i.e. that β

= 0). The long-run effect is -β1 /

4

(1-β3).

23 This approach can also be used to estimate the cost of the increase in vintage necessary to achieve a one-year increase in life exp ectancy. Suppose that H POST is equal to 1 if the person was alive at the date of the second interview, and equal to zero if the person had died. Then β1 is the effect of vintage on the probability of survival. Let LE(t) represent a person’s remaining life expectancy at year t, and S(t,t+1) represent the probability of survival from age t to age t+1. Then LE(t) ≈ S(t, t+1) * [1 + LE(t+1)], and

dLE / dV ≈ [1 + LE(t+1)] * (dS / dV) = [1 + LE(t+1)] * β1. Hence, we can obtain an approximate estimate of the effect of a one-year increase in vintage on life expectancy by multiplying β1 by mean remaining life expectancy of drug consumers. Since their mean age is 53, their mean remaining life expectancy is about 25 years. The cost of the increase in vintage necessary to achieve a one-year increase in life expectancy is therefore (dP rx / dV) / (25 * β1).

.671, or .00027. Previous authors have argued that the annual rate of embodied technical progress should be measured as the percentage change in output from a one-year increase in the vintage of an input divided by the input’s share in total cost of production. In our model, each prescription is regarded as a distinct input. The mean (across prescriptions) ratio of the cost of the prescription to total medical expenditure is 0.54%.24 Hence in this example (using this indicator of health), the rate of pharmaceutical-embodied technical progress is .00027 / .0054 = 5.0% per year.25

Estimates like these, while computed from cross-sectional micro data, have aggregate time-series implications. Mean vintage of drugs consumed tends to increase over time, e.g. drugs consumed in 1997 are of later vintage than drugs consumed in 1977. (In a steady state, the mean vintage of drugs would increase at the rate of one year per year.) The National Institute of Aging-sponsored study cited above found that “the number of older people who become severely disabled has been declining gradually for more than a decade, but the decline became much sharper at the end of the 1990's.”26

As Figure 4 indicates, there was a large increase in the mid-1990s in the number of new drugs approved. This increase, which was primarily due to enactment of the Prescription Drug User Fee Act, may help to explain the acceleration in the decline in disability at the end of th e 1990s.

Descriptive statistics. Summary statistics are presented in Table 2. These are presented at both the person level and the prescription level. The prescription-level statistics can be thought of as weighted person-level statistics, where the weight is the person’s number of prescriptions. People in poor health tend to consume more prescriptions than people in

24 This ignores the value of the time people devote to their own health care. As Folland et al (2001, p. 121) note, “The consumer does not merely purchase health passively from the market. Instead, the consumer produces it, spending time on health-improving efforts in addition to purchasing medical inputs.” Accounting for the value of time would reduce the ratio of the cost of the prescription to total health care cost, and increase the estimated rate of pharmaceutical-embodied technical progress.

25 The estimated rate of pharmaceutical-embodied technical progress is invariant with respect to the scale, but not the location, of the H POST measure. Suppose that Y* = c1Y, where c1 is a scale parameter (constant). Then if b is the slope of the regression of Y on X, and b* is the slope of the regression of Y* on X,

b* / mean (Y*) = (c1 b) / (c1 mean(Y)) = b / mean(Y). But if instead Y* = c0 + c1Y, where c0 is a location parameter (constant), b* / mean (Y*) = (c1 b) / (c0 + c1 mean(Y)) ≠ b / mean(Y). We code all of our H POST measures to take the value 0 for the worst health outcome (“zero health output”) and the value 1 for the best health outcome (“maximum health output”).

26 “Decrease in Chronic Illness Bodes Well for Medicare Costs,” New York Times, May 8, 2001.

excellent health, so prescription-level mean health is lower than person-level mean health. For example, 8% of individuals reported limitations in physical functioning in the initial interview, but 32% of prescriptions were consumed by individuals who reported limitations in physical functioning in the initial interview. Similarly, 0.26% of the individuals had died by the date of the second interview, but 0.80% of prescriptions were consumed by individuals who had died by the date of the second interview.27

Results

Table 3 presents estimates of β1 from equation H POST,i = β0 + β1 V ij + β2 Z i + diagnosis effects + u ij (excluding pre-treatment health), based on alternative samples (excluding vs. including observations with unknown vintages) and alternative measures of vintage (continuous vs. discrete). It also presents (in the first row) estimates of the effect of vintage on the price of a prescription in 1997.

The first column reports estimates based on the subset of observations where vintage is known, and where the vintage measure is continuous. The Rx price coefficient of 1.25 indicates that a one-year increase in vintage increases the price of a prescription by $1.25 (3.2%), on average. Looking down the first column, only one of the vintage coefficients—on “absence of social limitations”--is significant at the 5 percent level.

Estimates reported in the second column are also based on the subset of observations where vintage is known, but the vintage measure is discrete: if the vintage is less than or equal to 1970, it is replaced by the mean vintage of 1939-1970 drugs (1957.7), and if the vintage is greater than 1970, it is replaced by the mean vintage of 1971-1997 drugs (1984.6). A number of the coefficients on this discrete measure of vintage—the coefficients from ALIVE, perceived health status, the quality of life index, absence of limitations on work/housework/school, absence of social limitations, and mean level of difficulty regressions--are positive and highly statistically significant. This is consistent with the view that vintage is subject to measurement error, which tends to bias the vintage coefficient towards zero, and this bias can be attenuated by grouping prescriptions according to measured vintage.

27 Because poor health and mortality are relatively uncommon at the person level, the fact that sicker people consume more drugs is likely to increase the power of statistical tests performed at the prescription level, where these outcomes are less uncommon.

Estimates reported in the third column are based on the full sample of prescriptions; in this column the vintage of prescriptions of unknown (pre-1939) vintage is assumed to be 1900. As in the first column, vintage is measured as a continuous variable. Notice first that the Rx-price coefficient is much smaller in column 3 than it is in the first two columns. That is because the Rx-price/vintage frontier is quite nonlinear—it is much steeper for vintages greater than 1970 than it is for older vintages—and the sample on which column 3 estimates are based include more old drugs. This estimate implies that, when all drugs are considered (and the value 1900 is imputed for missing vintages), a one-year increase in vintage increased the price of a 1997 prescription by $0.35 (about 1%), on average.

The vintage coefficients in seven of the nine health indicator regressions in column 3 are positive and highly significant, suggesting that people who use newer drugs had better post-treatment health than people using older drugs for the same condition, controlling for age, sex, race, marital status, education, income, and insurance coverage. Although the effect of vintage on h ealth is generally insignificant when a continuous vintage measure is used and the sample is restricted to drugs with known (post-1939) vintages (column 1), the effect of vintage on health is generally significant when either a discrete vintage measure is used (column 2) or the sample is not restricted to drugs with known vintages (column 3).

Estimates reported in the fourth column are also based on the full sample of prescriptions and a continuous vintage measure; in this column the vintage of prescriptions of unknown (pre-1939) vintage is assumed to be 1920, rather than 1900. In general, this increases the point estimates of the vintage coefficients: the rate of health improvement with respect to vintage appears to be larger, since the old drugs are assumed to be less old. But the coefficients don’t change by an enormous amount, and they remain highly significant, suggesting that our results won’t be too sensitive to the choice of imputed value for missing vintages.28 Since the t-statistics in column 3 are generally larger than those in column 4, henceforth we will impute 1900 to missing vintages.

28 Since the Rx-price coefficient is also higher in column 4 than it is in column 3, estimates of dP

/ dH POST

rx

= (dP r x / dV) / β1 from the two columns will be quite similar.

经典的串口调试工具源代码(一)

经典的串口调试助手源代码(一) Dim OutputAscii As Boolean Dim InputString As String Dim OutputString As String '============================================================================== ======= ' 变量定义 '============================================================================== ======= Option Explicit ' 强制显式声明 Dim ComSwitch As Boolean ' 串口开关状态判断 Dim FileData As String ' 要发送的文件暂存Dim SendCount As Long ' 发送数据字节计数器 Dim ReceiveCount As Long ' 接收数据字节计数器Dim InputSignal As String ' 接收缓冲暂存 Dim OutputSignal As String ' 发送数据暂存 Dim DisplaySwitch As Boolean ' 显示开关 Dim ModeSend As Boolean ' 发送方式判断

Dim Savetime As Single ' 时间数据暂存延时用Dim SaveTextPath As String ' 保存文本路径 ' 网页超链接申明 Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Sub CloseCom() '关闭串口 On Error GoTo Err If MSComm.PortOpen = True Then MSComm.PortOpen = False ' 先判断串口是否打 开,如果打开则先关闭 txtstatus.Text = "STATUS:COM Port Cloced" ' 串口状态显示 mnuconnect.Caption = "断开串口" cmdswitch.Caption = "打开串口" 'ImgSwitch.Picture = LoadPicture("f:\我的VB\串口调试软件\图片\guan.jpg") ' 显示串口已经关闭 的图标 ImgSwitchoff.Visible = True ImgSwitchon.Visible = False Err: End Sub Private Sub UpdateStatus() If MSComm.PortOpen Then StatusBar1.Panels(1).Text = "Connected" mnuautosend.Caption = "自动发送" mnuconnect.Caption = "断开串口" Else StatusBar1.Panels(1).Text = "断开串口" mnuautosend.Caption = "disautosend" mnuconnect.Caption = "打开串口" End If StatusBar1.Panels(2).Text = "COM" & https://www.doczj.com/doc/1114157670.html,mPort StatusBar1.Panels(3).Text = MSComm.Settings If (OutputAscii) Then StatusBar1.Panels(4) = "ASCII" Else StatusBar1.Panels(4) = "HEX" End If ' On Error GoTo Err If ChkAutoSend.Value = 1 Then ' 如果有效则,自动发送

Excel常用函数及使用方法

excel常用函数及使用方法 一、数字处理 (一)取绝对值:=ABS(数字) (二)数字取整:=INT(数字) (三)数字四舍五入:=ROUND(数字,小数位数) 二、判断公式 (一)把公式返回的错误值显示为空: 1、公式:C2=IFERROR(A2/B2,"") 2、说明:如果是错误值则显示为空,否则正常显示。 (二)IF的多条件判断 1、公式:C2=IF(AND(A2<500,B2="未到期"),"补款","") 2、说明:两个条件同时成立用AND,任一个成立用OR函数。 三、统计公式 (一)统计两表重复 1、公式:B2=COUNTIF(Sheet15!A:A,A2) 2、说明:如果返回值大于0说明在另一个表中存在,0则不存在。 (二)统计年龄在30~40之间的员工个数 公式=FREQUENCY(D2:D8,{40,29} (三)统计不重复的总人数 1、公式:C2=SUMPRODUCT(1/COUNTIF(A2:A8,A2:A8)) 2、说明:用COUNTIF统计出每人的出现次数,用1除的方式把出现次数变成分母,然后相加。

(四)按多条件统计平均值 =AVERAGEIFS(D:D,B:B,"财务",C:C,"大专") (五)中国式排名公式 =SUMPRODUCT(($D$4:$D$9>=D4)*(1/COUNTIF(D$4:D$9,D$4:D$9))) 四、求和公式 (一)隔列求和 1、公式:H3=SUMIF($A$2:$G$2,H$2,A3:G3) 或=SUMPRODUCT((MOD(COLUMN(B3:G3),2)=0)*B3:G3) 2、说明:如果标题行没有规则用第2个公式 (二)单条件求和 1、公式:F2=SUMIF(A:A,E2,C:C) 2、说明:SUMIF函数的基本用法 (三)单条件模糊求和 说明:如果需要进行模糊求和,就需要掌握通配符的使用,其中星号是表示任意多个字符,如"*A*"就表示a前和后有任意多个字符,即包含A。 (四)多条求模糊求和 1、公式:=SUMIFS(C2:C7,A2:A7,A11&"*",B2:B7,B11) 2、说明:在sumifs中可以使用通配符* (五)多表相同位置求和 1、公式:=SUM(Sheet1:Sheet19!B2) 2、说明:在表中间删除或添加表后,公式结果会自动更新。

虚拟声卡驱动程序VirtualAudioCable使用方法

一:安装软件 点击 选择是(Y) 选择I accept 选择Install 安装成功,点击“确定”按钮即完成安装。 二、软件的设置 点击桌面开始按钮所有程序---Virtual Audio Cable —Control panel 进入软件初始化 设置。 在Cables 中选择1(即首次设置一个虚拟通道),点击旁边的Set 按钮生成通道Cable1. 在参数设置区将Line 、Mic (可选可不选)、S/PDIF (可选可不选)三个选项后面的方框打钩,选中之后点击参数设置区内的设置按钮Set ,即完成了,对虚拟声卡通道1 的设置。 鼠标右键点击桌面右下角的喇叭------ 调整音频属性---- < 或者点击开始—控制面板--- 声音、 语音和音频设备--- 声音和音频设备>弹出: 选择语音 此时语音部分的设置为原系统默认的设备,保持不变。 选择音频: 改变声音播放、录音的选项内容:

如上图将声音播放、录音的默认设备全部改为Virtual Cable 1 。点击应用--- 确定即可。 三、打开录音机录音--- 录制电脑里播放出来的音频(不包含麦克风 里的声音) - 即“内录” 开始--- 所有程序—附件--- 娱乐--- 录音机 点击确定即可开始录音(注:此时可在电脑中打开相应的音频文件,开始录音) 此时音频波段显示有声音输入,但是电脑的耳机听不到正在播放的音频文件(属正常现象)。若想同时听到音频文件的内容点击桌面开始按钮所有程序---Virtual Audio Cable —Audio Repeater 。 修改为 点击Start 即可听到正在录制的音频文件。此时的录音即是通过虚拟声卡通道录制电脑里的声音的。 四、同时录电脑里播放的声音和麦克风收集的外部声音----- 即混录 <通过这种方法解决现有笔记本无“立体声混音”或“波形音”选项的问题> 在《三打开录音机录音--- 录制电脑里播放出来的音频(不包含麦克风里的声音)------------ 即“内录”》的同时,在打开一个irtual Audio Cable —Audio Repeater 窗口将其设置为: 即将外部麦克风收集的声音转移到虚拟声卡通道Cable1 中,同电脑里播放的声音一起被录音软件收录为音频文件。

VLOOKUP函数的使用方法

VLOOKUP函数的使用方法(入门级) 一、入门级 VLOOKUP是一个查找函数,给定一个查找的目标,它就能从指定的查找区域中查找返回想要查找到的值。它的基本语法为: VLOOKUP(查找目标,查找范围,返回值的列数,精确OR模糊查找) 下面以一个实例来介绍一下这四个参数的使用 例1:如下图所示,要求根据表二中的姓名,查找姓名所对应的年龄。 公式:B13 =VLOOKUP(A13,$B$2:$D$8,3,0) 参数说明: 1 查找目标:就是你指定的查找的内容或单元格引用。本例中表二A列的姓名就是查找目标。我们要根据表二的“姓名”在表一中A列进行查找。 公式:B13 =VLOOKUP(A13,$B$2:$D$8,3,0) 2 查找范围(VLOOKUP(A13,$B$2:$D$8,3,0) ):指定了查找目标,如果没有说从哪里查找,EXCEL肯定会很为难。所以下一步我们就要指定从哪个范围中进行查找。VLOOKUP的这第二个参数可以从一个单元格区域中查找,也可以从一个常量数组或内存数组中查找。本例中要从表一中进行查找,那么范围我

们要怎么指定呢?这里也是极易出错的地方。大家一定要注意,给定的第二个参数查找范围要符合以下条件才不会出错: A 查找目标一定要在该区域的第一列。本例中查找表二的姓名,那么姓名所对应的表一的姓名列,那么表一的姓名列(列)一定要是查找区域的第一列。象本例中,给定的区域要从第二列开始,即$B$2:$D$8,而不能是$A$2:$D$8。因为查找的“姓名”不在$A$2:$D$8区域的第一列。 B 该区域中一定要包含要返回值所在的列,本例中要返回的值是年龄。年龄列(表一的D列)一定要包括在这个范围内,即:$B$2:$D$8,如果写成$B $2:$C$8就是错的。 3 返回值的列数(B13 =VLOOKUP(A13,$B$2:$D$8,3,0))。这是VLOOKU P第3个参数。它是一个整数值。它怎么得来的呢。它是“返回值”在第二个参数给定的区域中的列数。本例中我们要返回的是“年龄”,它是第二个参数查找范围$B$2:$D$8的第3列。这里一定要注意,列数不是在工作表中的列数(不是第4列),而是在查找范围区域的第几列。如果本例中要是查找姓名所对应的性别,第3个参数的值应该设置为多少呢。答案是2。因为性别在$B$2:$D$8的第2列中。 4 精确OR模糊查找(VLOOKUP(A13,$B$2:$D$8,3,0) ),最后一个参数是决定函数精确和模糊查找的关键。精确即完全一样,模糊即包含的意思。第4个参数如果指定值是0或FALSE就表示精确查找,而值为1 或TRUE时则表示模糊。这里兰色提醒大家切记切记,在使用VLOOKUP时千万不要把这个参数给漏掉了,如果缺少这个参数默为值为模糊查找,我们就无法精确查找到结果了。 VLOOKUP函数的使用方法(初级篇)一、VLOOKUP多行查找时复制公式的问题 VLOOKUP函数的第三个参数是查找返回值所在的列数,如果我们需要查找返回多列时,这个列数值需要一个个的更改,比如返回第2列的,参数设置为2,如果需要返回第3列的,就需要把值改为3。。。如果有十几列会很麻烦的。那么能不能让第3个参数自动变呢?向后复制时自动变为2,3,4,5。。。 在EXCEL中有一个函数COLUMN,它可以返回指定单元格的列数,比如 =COLUMNS(A1)返回值1 =COLUMNS(B1)返回值2

(通信企业管理)经典串口调试助手源程序及串口通信设置精编

(通信企业管理)经典串口调试助手源程序及串口通 信设置

串口调试助手源程序 及编程详细过程 作者:龚建伟2001.6.20 能够任意转载,但必须注明作者和说明来自https://www.doczj.com/doc/1114157670.html,,不得作为商用 目次: 1.建立项目 2.于项目中插入MSComm控件 3.利用ClassWizard定义CMSComm类控制变量 4.于对话框中添加控件 5.添加串口事件消息处理函数OnComm() 6.打开和设置串口参数 7.发送数据 如果你仍没有下载源程序,又对本文有兴趣,请立即下载 于众多网友的支持下,串口调试助手从2001年5月21日发布至今,短短壹个月,于全国各地累计下载量近5000人次,于近200多个电子邮件中,20多人提供了使用测试意见,更有50多位朋友提出要串口调试助手的源代码,为了答谢谢朋友们的支持,公开推出我最初用VC控件MSComm编写串口通信程序的源代码,且写出详细的编程过程,姑且叫串口调试助手源程序V1.0或VC串口通讯源程序吧,我相信,如果你用VC编程,那么有了这个代码,就能够轻而易举地完成串口编程任务了。(也许本文过于详细,高手就不用见) 开始吧: 1.建立项目:打开VC++6.0,建立壹个基于对话框的MFC应用程序SCommTest(和我源代码壹致,等会你会方便壹点); 2.于项目中插入MSComm控件选择Project菜单下AddToProject子菜单中的ComponentsandControls…选项,于弹出的对话框中双击RegisteredActiveXControls项(稍等壹会,这个过程较慢),则所有注册过的ActiveX控件出当下列表框中。选择MicrosoftCommunicationsControl,version6.0,,单击Insert按钮将它插入到我们的Project中来,接受缺省的选项。(如果你于控件列表中见不到MicrosoftCommunicationsControl,version6.0,那可能是你于安装VC6时没有把ActiveX壹项选上,重新安装VC6,选上ActiveX就能够了),

excel 函数的公式语法和用法

SUMIF 函数的公式语法和用法。 说明 使用SUMIF函数可以对区域中符合指定条件的值求和。例如,假设在含有数字的某一列中,需要让大于5 的数值相加,请使用以下公式: =SUMIF(B2:B25,">5") 在本例中,应用条件的值即要求和的值。如果需要,可以将条件应用于某个单元格区域,但却对另一个单元格区域中的对应值求和。例如,使用公式=SUMIF(B2:B5, "John", C2:C5)时,该函数仅对单元格区域C2:C5 中与单元格区域B2:B5 中等于“John”的单元格对应的单元格中的值求和。注释若要根据多个条件对若干单元格求和,请参阅SUMIFS 函数。 语法 SUMIF(range, criteria, [sum_range]) SUMIF函数语法具有以下参数: range必需。用于条件计算的单元格区域。每个区域中的单元格都必须是数字或名称、数组或包含数字的引用。空值和文本值将被忽略。 criteria必需。用于确定对哪些单元格求和的条件,其形式可以为数字、表达式、单元格 引用、文本或函数。例如,条件可以表示为32、">32"、B5、32、"32"、"苹果" 或TODAY()。 要点任何文本条件或任何含有逻辑或数学符号的条件都必须使用双引号(") 括起来。如果条件为数字,则无需使用双引号。

sum_range可选。要求和的实际单元格(如果要对未在range 参数中指定的单元格求和)。 如果sum_range参数被省略,Excel 会对在range参数中指定的单元格(即应用条件的单元格)求和。 注释 sum_range 参数与range参数的大小和形状可以不同。求和的实际单元格通过以下方法确定:使用sum_range参数中左上角的单元格作为起始单元格,然后包括与range参数大小和形状相对应的单元格。例如: 如果区域是并且sum_range 是则需要求和的实际单元格是 A1:A5 B1:B5 B1:B5 A1:A5 B1:B3 B1:B5 A1:B4 C1:D4 C1:D4 A1:B4 C1:C2 C1:D4 可以在criteria参数中使用通配符(包括问号(?) 和星号(*))。问号匹配任意单个字符; 星号匹配任意一串字符。如果要查找实际的问号或星号,请在该字符前键入波形符(~)。示例 示例1 如果将示例复制到一个空白工作表中,可能会更容易理解该示例。 如何复制示例? 1.选择本文中的示例。

编译hello设备驱动程序详细过程

编译hello world设备驱动程序详细过程 1、安装与你的开发板相同的内核版本的虚拟机,我的板子内核是2.6.8.1,虚拟机是2.6.9, 一般是虚拟机的内核只能比板子内核新,不能旧 #uanme –a [1](在任何目录下,输入此命令,查看虚拟机的内核版本,我的内核版本是2.6.9) 2、在虚拟机上设置共享目录,我的共享目录在linux下的/mnt/hgfs/share [2]share是自己命名的,我的物理机上,即Windows下的目录是G:/share, 3、在Windows下,把开发板的的交叉开发工具链[3],内核源码包[4],复制到物理机的共享目录下[5] 即Windows下的目录是G:/share, 4、#cp /mnt/hgfs/share/cross-3.3.2.tar.bz2 /usr/local/arm [6] 在Linux下,把交叉工具链,复制到/usr/local/arm目录下 5、#cd /usr/local/arm 6、#tar jxvf cross-3.3.2.tar.bz2 [7] 并在当前目录/usr/local/arm下解压它cross-2.95.3.tar.bz2和gec2410-linux-2.6.8.tar.bz2也是用同样的命令去解压 7、#export PATH=/usr/local/arm/3.3.2/bin:$PATH [8] 安装交叉工具链,在需要使用交叉编译时,只要在终端输入如下命令 #export PATH=/usr/local/arm/版本/bin:$PATH 即可,在需要更改不同版本的工具链时,重新启动一个终端,然后再一次输入上面的命令即可,使用哪个版本的交叉工具链,视你要编译的内核版本决定,编译2.4版本的内核,则用2.95.3版本的交叉工具链,而2.6版本内核的,则要用3.3.2版本的交叉工具链。 8、#cp gec2410-linux-2.6.8.tar.bz2 /root [9]把内核拷贝到/root目录下, 9、#cd /root 10、#tar gec2410-linux-2.6.8.tar.bz2 [10] 在/root解压开发板的内核源码压缩包gec2410-linux-2.6.8.tar.bz2,得到gec2410-linux-2.6.8.1文件夹 11、#cd /root/ gec2410-linux-2.6.8.1 12、#cp gec2410.cfg .config [11] gec2410.cfg文件是广嵌开发板提供的默认内核配置文件,在这里首先把内核配置成默认配置,然后在此基础上用make menuconfig进一步配置,但在这里,不进行进一步的配置,对于内核配置,还需要看更多的知识,在这里先存疑。 13、#make [12]在内核源代码的根目录gec2410-linux-2.6.8.1下用make命令编译内核,注意,先安装交叉工具链,再编译内核,因为这里编译的hello.ko驱动模块最终是下载到开发板上运行的,而不是在虚拟机的Linux系统运行的,如果是为了在虚拟机的Linux系统运行的,则不用安装交叉编译工具链arm-linux-gcc,而直接用gcc,用命令#arm-linux-gcc –v 可以查看当前已经安装的交叉编译工具链的版本。这里编译内核不是为了得到内核的映象文件zImage(虽然会得到内核的映象文件zImage),而是为了得到编译hello.o模块需要相关联,相依赖(depends on)的模块。 14、#cd /root 12、#mkdir hello [13]在/root目录下建立hello文件夹, 13、#cd hel 14 、#vi hello.c [12]编辑hello.c文件,内容是《Linux设备驱动程序》第三版22页的hello world程序。 15、#vi Makefile [13]在hello文件夹下编辑Makefile文件, 16、obj-m := module.o [14] 这是Makefile的内容,为obj-m := module.omodule.o视你编辑的.c文件而定,这里则要写成hello.o,写完后,保存退出。 17、cd /root/hello

Excel表格中的一些基本函数使用方法

Excel表格中的一些基本函数使用方法 一、输入三个“=”,回车,得到一条双直线; 二、输入三个“~”,回车,得到一条波浪线; 三、输入三个“*”或“-”或“#”,回车,惊喜多多; 在单元格内输入=now()显示日期 在单元格内输入=CHOOSE(WEEKDAY(I3,2),"星期一","星期二","星期三","星期四","星期五","星期六","星期日") 显示星期几 Excel常用函数大全 1、ABS函数 函数名称:ABS 主要功能:求出相应数字的绝对值。 使用格式:ABS(number) 参数说明:number代表需要求绝对值的数值或引用的单元格。 应用举例:如果在B2单元格中输入公式:=ABS(A2),则在A2单元格中无论输入正数(如100)还是负数(如-100),B2中均显示出正数(如100)。 特别提醒:如果number参数不是数值,而是一些字符(如A等),则B2中返回错误值“#VALUE!”。 2、AND函数 函数名称:AND 主要功能:返回逻辑值:如果所有参数值均为逻辑“真(TRUE)”,则返回逻辑“真(TRUE)”,反之返回逻辑“假(FALSE)”。

使用格式:AND(logical1,logical2, ...) 参数说明:Logical1,Logical2,Logical3……:表示待测试的条件值或表达式,最多这30个。 应用举例:在C5单元格输入公式:=AND(A5>=60,B5>=60),确认。如果C5中返回TRUE,说明A5和B5中的数值均大于等于60,如果返回FALSE,说明A5和B5中的数值至少有一个小于60。 特别提醒:如果指定的逻辑条件参数中包含非逻辑值时,则函数返回错误值“#VALUE!”或“#NAME”。 3、AVERAGE函数 函数名称:AVERAGE 主要功能:求出所有参数的算术平均值。 使用格式:AVERAGE(number1,number2,……) 参数说明:number1,number2,……:需要求平均值的数值或引用单元格(区域),参数不超过30个。 应用举例:在B8单元格中输入公式: =AVERAGE(B7:D7,F7:H7,7,8),确认后,即可求出B7至D7区域、F7至H7区域中的数值和7、8的平均值。 特别提醒:如果引用区域中包含“0”值单元格,则计算在内;如果引用区域中包含空白或字符单元格,则不计算在内。 4、COLUMN 函数 函数名称:COLUMN 主要功能:显示所引用单元格的列标号值。

串口调试助手VC++6.0程序

串口调试助手源程序 及编程详细过程 作者:龚建伟 2001.6.20 可以任意转载,但必须注明作者和说明来自https://www.doczj.com/doc/1114157670.html,,不得作为商用 目次: 1.建立项目 2.在项目中插入MSComm控件 3.利用ClassWizard定义CMSComm类控制变量 4.在对话框中添加控件 5.添加串口事件消息处理函数OnComm() 6.打开和设置串口参数 7.发送数据 在众多网友的支持下,串口调试助手从2001年5月21日发布至今,短短一个月,在全国各地累计下载量近5000人次,在近200多个电子邮件中,20多人提供了使用测试意见,更有50多位朋友提出要串口调试助手的源代码,为了答谢谢朋友们的支持,公开推出我最初用VC控件MSComm编写串口通信程序的源代码,并写出详细的编程过程,姑且叫串口调试助手源程序V1.0或VC串口通讯源程序吧,我相信,如果你用VC编程,那么有了这个代码,就可以轻而易举地完成串口编程任务了。(也许本文过于详细,高手就不用看) 开始吧: 1.建立项目:打开VC++6.0,建立一个基于对话框的MFC应用程序SCommTest(与我源代码一致,等会你会方便一点); 2.在项目中插入MSComm控件选择Project菜单下Add To Project子菜单中的 Components and Controls…选项,在弹出的对话框中双击Registered ActiveX Controls项(稍等一会,这个过程较慢),则所有注册过的ActiveX控件出现在列表框中。选择Microsoft Communications Control, version 6.0,,单击Insert按钮将它插入到我们的Project中来,接受缺省的选项。(如果你在控件列表中看不到Microsoft Communications Control, version 6.0,

EXCEL中常用函数及使用方法

EXCEL中常用函数及使用方法 Excel函数一共有11类:数据库函数、日期与时间函数、工程函数、财务函数、信息函数、逻辑函数、查询和引用函数、数学和三角函数、统计函数、文本函数以及用户自定义函数。 1.数据库函数 当需要分析数据清单中的数值是否符合特定条件时,可以使用数据库工作表函数。例如,在一个包含销售信息的数据清单中,可以计算出所有销售数值大于1,000 且小于2,500 的行或记录的总数。Microsoft Excel 共有12 个工作表函数用于对存储在数据清单或数据库中的数据进行分析,这些函数的统一名称为Dfunctions,也称为D 函数,每个函数均有三个相同的参数:database、field 和criteria。这些参数指向数据库函数所使用的工作表区域。其中参数database 为工作表上包含数据清单的区域。参数field 为需要汇总的列的标志。参数criteria 为工作表上包含指定条件的区域。 2.日期与时间函数 通过日期与时间函数,可以在公式中分析和处理日期值和时间值。 3.工程函数 工程工作表函数用于工程分析。这类函数中的大多数可分为三种类型:对复数进行处理的函数、在不同的数字系统(如十进制系统、十六进制系统、八进制系统和二进制系统)间进行数值转换的函数、在不同的度量系统中进行数值转换的函数。 4.财务函数 财务函数可以进行一般的财务计算,如确定贷款的支付额、投资的未来值或净现值,以及债券或息票的价值。财务函数中常见的参数: 未来值(fv)--在所有付款发生后的投资或贷款的价值。 期间数(nper)--投资的总支付期间数。 付款(pmt)--对于一项投资或贷款的定期支付数额。 现值(pv)--在投资期初的投资或贷款的价值。例如,贷款的现值为所借入的本金数额。 利率(rate)--投资或贷款的利率或贴现率。 类型(type)--付款期间内进行支付的间隔,如在月初或月末。 5.信息函数 可以使用信息工作表函数确定存储在单元格中的数据的类型。信息函数包含一组称为IS 的工作表函数,在单元格满足条件时返回TRUE。例如,如果单元格包含一个偶数值,ISEVEN 工作表函数返回TRUE。如果需要确定某个单元格区域中是否存在空白单元格,可以使用COUNTBLANK 工作表函数对单元格区域中的空白单元格进行计数,或者使用ISBLANK 工作表函数确定区域中的某个单元格是否为空。 6.逻辑函数 使用逻辑函数可以进行真假值判断,或者进行复合检验。例如,可以使用IF 函数确定条件为真还是假,并由此返回不同的数值。

VBNET开发全功能串口调试助手

https://www.doczj.com/doc/1114157670.html, 开发全功能串口调试助手(含完整工程) 小记:https://www.doczj.com/doc/1114157670.html, 的串口通信用了很长时间了,也只用 Write 和Read 这样的方 法,以前都是用这种方式做上位机软件, 如此足矣。而前几天研究GSM 模块时对 串口返回的数据总是把握不好,参考开发板附送的例程,发现采用 SerialPort 的DataReceived 事件,可以实现中断触发式的数据接收。于是想到要自己做一 个串口调试助手,在实现基本功能的前提下增加一些方便自己调试的功能。 经过 断断续续的编写,就做成了下面这个小软件: 这个软件能够实现串口调试助手的全部功能,经过通信测试,数据接收性能 不亚于呼啸工作室的SComAssistant2.2,通过加大输入缓冲区,可以满足大量 数据接收。 https://www.doczj.com/doc/1114157670.html, 的串口通信主要使用 VS 自带的SerialPort 控件,而不是早先的 MSComm 更具有兼容性,这也是很久以前就放弃 VB 改用.NET 的直接原因。该控 件的主要方法、属性如下(该数据来自 VS 的MSD 帮助库):

想要通过串口收发数据,就需要对串口进行配置,包括设置端口、波特率、数据格式(如COM端口、9600bps、8位数据位、无校验位、1位停止位)等属性,之后通过Open方法打开串口。打开串口可通过手动指定,也可以使用GetPortNames 方法获取计算机中存在的串口。如果打开出错,则可能是串口不存在或者已被占用。下面是相应代码: Private SubSerialPortOpen() On Error GoToErr If SerialPort.IsOpen = True ThenSerialPort.Close() '避免重复打开端 口 SerialPort.Ope n() LabelCOMStatus.Text ="串口已打开" Exit Sub Err: MsgBox(‘ 串口不存在或已被占用!" + vbNewLine + ErrorToString()) ' 出现错误,显示错误信息 En dSub 如果想要在串口中支持中文字符收发,则可在初始化时设置串口控件的编码: SerialPort.E ncodi ng = System.Text.E ncodi ng.Default 发送数据通过Write方法来完成,由于串口调试助手需要支持文本和16进制, 需要加入转换代码: Private SubButtonSendData_Click( ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles ButtonSendData.Click On Error GoToErr

EXCEL电子表格中四个常用函数的用法

EXCEL电子表格中四个常用函数的用法 (2010-01-16 09:59:27) 转载▼ 分类:Excel学习 标签: 杂谈 EXCEL电子表格中四个常用函数的用 法 现在介绍四个常用函数的用法:COUNT(用于计算单元格区域中数字值的个数)、COUNTA(用于计算单元格区域中非空白单元格的个数)、COUNTBLANK(用于计算单元格区域中空白单元格的个数)、COUNTIF(用于计算符合一定条件的COUNTBLANK单元格个数)。 结合例子将具体介绍:如何利用函数COUNTA统计本班应考人数(总人数)、利用函数COUNT统计实际参加考试人数、利用函数COUNTBLANK统计各科缺考人数、利用函数COUNTIF统计各科各分数段的人数。首先,在上期最后形成的表格的最后添加一些字段名和合并一些单元格,见图1。 一、利用函数COUNTA统计本班的应考人数(总人数) 因为函数COUNTA可以计算出非空单元格的个数,所以我们在利用此函数时,选取本班学生名字所在单元格区域(B3~B12)作为统计对象,就可计算出本班的应考人数(总人数)。 1.选取存放本班总人数的单元格,此单元格是一个经过合并后的大单元格(C18~G18); 2.选取函数;单击菜单“插入/函数”或工具栏中的函数按钮f*,打开“粘贴函数”对话框,在“函数分类”列表中选择函数类别“统计”,然后在“函数名”列表中选择需要的函数“COUNTA”,按“确定”按钮退出“粘贴函数”对话框。 3.选取需要统计的单元格区域;在打开的“函数向导”对话框中,选取需要计算的单元格区域B3~B13,按下回车键以确认选取;“函数向导”对话框图再次出现在屏幕上,按下“确定”按钮,就可以看到计算出来本班的应考人数(总人数)了。

虚拟设备驱动程序的设计与实现

虚拟设备驱动程序的设计与实现 由于Windows对系统底层操作采取了屏蔽的策略,因而对用户而言,系统变得 更为安全,但这却给众多的硬件或者系统软件开发人员带来了不小的困难,因为只要应用中涉及到底层的操作,开发人员就不得不深入到Windows的内核去编写属 于系统级的虚拟设备驱动程序。Win 98与Win 95设备驱动程序的机理不尽相同,Win 98不仅支持与Windows NT 5.0兼容的WDM(Win32 Driver Mode)模式驱动程序 ,而且还支持与Win 95兼容的虚拟设备驱动程序VxD(Virtual Device Driver)。下面介绍了基于Windows 9x平台的虚拟环境、虚拟设备驱动程序VxD的基本原理和 设计方法,并结合开发工具VToolsD给出了一个为可视电话音频卡配套的虚拟设备 驱动程序VxD的设计实例。 1.Windows 9x的虚拟环境 Windows 9x作为一个完整的32位多任务操作系统,它不像Window 3.x那样依 赖于MS-DOS,但为了保证软件的兼容性,Windows 9x除了支持Win16应用程序和 Win32应用程序之外,还得支持MS-DOS应用程序的运行。Windows 9x是通过虚拟机 VM(Virtual Machine)环境来确保其兼容和多任务特性的。 所谓Windows虚拟机(通常简称为Windows VM)就是指执行应用程序的虚拟环 境,它包括MS-DOS VM和System VM两种虚拟机环境。在每一个MS-DOS VM中都只运 行一个MS-DOS进程,而System VM能为所有的Windows应用程序和动态链接库DLL(Dynamic Link Libraries)提供运行环境。每个虚拟机都有独立的地址空间、寄存器状态、堆栈、局部描述符表、中断表状态和执行优先权。虽然Win16、Win32应用程序都运行在System VM环境下,但Win16应用程序共享同一地址空间, 而Win32应用程序却有自己独立的地址空间。 在编写应用程序时,编程人员经常忽略虚拟环境和实环境之间的差异,一般认为虚拟环境也就是实环境。但是,在编写虚拟设备驱动程序VxD时却不能这样做 ,因为VxD的工作是向应用程序代码提供一个与硬件接口的环境,为每一个客户虚 拟机管理虚设备的状态,透明地仲裁多个应用程序,同时对底层硬件进行访问。这就是所谓虚拟化的概念。 VxD在虚拟机管理器VMM(Virtual Machine Manager)的监控下运行,而VMM 实 际上是一个特殊的VxD。VMM执行与系统资源有关的工作,提供虚拟机环境(能产

Excel常用函数的使用方法

1、ABS函数 函数名称:ABS 主要功能:求出相应数字的绝对值。 使用格式:ABS(number) 参数说明:number代表需要求绝对值的数值或引用的单元格。 应用举例:如果在B2单元格中输入公式:=ABS(A2),则在A2单元格中无论输入正数(如100)还是负数(如-100),B2中均显示出正数(如100)。 特别提醒:如果number参数不是数值,而是一些字符(如A等),则B2中返回错误值“#VALUE!”。 2、AND函数 函数名称:AND 主要功能:返回逻辑值:如果所有参数值均为逻辑“真(TRUE)”,则返回逻辑“真(TRUE)”,反之返回逻辑“假(FALSE)”。 使用格式:AND(logical1,logical2, ...) 参数说明:Logical1,Logical2,Logical3……:表示待测试的条件值或表达式,最多这30个。 应用举例:在C5单元格输入公式:=AND(A5>=60,B5>=60),确认。如果C5中返回TRUE,说明A5和B5中的数值均大于等于60,如果返回FALSE,说明A5和B5中的数值至少有一个小于60。 特别提醒:如果指定的逻辑条件参数中包含非逻辑值时,则函数返回错误值“#VALUE!”或“#NAME”。 3、AVERAGE函数 函数名称:AVERAGE 主要功能:求出所有参数的算术平均值。 使用格式:AVERAGE(number1,number2,……) 参数说明:number1,number2,……:需要求平均值的数值或引用单元格(区域),参数不超过30个。

应用举例:在B8单元格中输入公式:=AVERAGE(B7:D7,F7:H7,7,8),确认后,即可求出B7至D7区域、F7至H7区域中的数值和7、8的平均值。 特别提醒:如果引用区域中包含“0”值单元格,则计算在内;如果引用区域中包含空白或字符单元格,则不计算在内。 4、COLUMN 函数 函数名称:COLUMN 主要功能:显示所引用单元格的列标号值。 使用格式:COLUMN(reference) 参数说明:reference为引用的单元格。 应用举例:在C11单元格中输入公式:=COLUMN(B11),确认后显示为2(即B列)。 特别提醒:如果在B11单元格中输入公式:=COLUMN(),也显示出2;与之相对应的还有一个返回行标号值的函数——ROW(reference)。 5、CONCATENATE函数 函数名称:CONCATENATE 主要功能:将多个字符文本或单元格中的数据连接在一起,显示在一个单元格中。 使用格式:CONCATENATE(Text1,Text……) 参数说明:Text1、Text2……为需要连接的字符文本或引用的单元格。 应用举例:在C14单元格中输入公式:=CONCATENATE(A14,"@",B14,".com"),确认后,即可将A14单元格中字符、@、B14单元格中的字符和.com连接成一个整体,显示在C14单元格中。 特别提醒:如果参数不是引用的单元格,且为文本格式的,请给参数加上英文状态下的双引号,如果将上述公式改为:=A14&"@"&B14&".com",也能达到相同的目的。 6、COUNTIF函数 函数名称:COUNTIF 主要功能:统计某个单元格区域中符合指定条件的单元格数目。 使用格式:COUNTIF(Range,Criteria) 参数说明:Range代表要统计的单元格区域;Criteria表示指定的条件表达式。

串口调试助手c开发

1.建立项目: 打开VC+ + 6.0,建立一个基于对话框的MFC应用程序SCommTest(与我 源代码一致,等会你会方便一点); 2.在项目中插入MSComm控件 选择Project菜单下Add To Project子菜单中的Componentsand Controls,选项,在弹出的对话框中双击Registered ActiveXControls项(稍等一会,这个过程较慢),则所有注册过的ActiveX控件出现在列表框中。选择Microsoft Communications Control,version6.0,,单击Insert 按钮将它插入到我们的Project 中来,接受缺省的选项。(如果你在控件列表中看不到Microsoft Communications Control, version 6.0,那可能是你在安装VC6时没有把ActiveX 一项选上,重新安装VC6,选上ActiveX就可以了),这时在ClassView 视窗中就可以看到CMSComm类了,(注意:此类在ClassWizard中看不到,重构clw文件也一样),并且在控件工具栏Controls中出现了电话图标(如图1所示),现在要做的是用鼠标将此图标拖到对话框中,程序运行后,这个图标是看不到的。3.利用ClassWizard定义CMSComm类控制对象 打开ClassWizard- >Member Viariables 选项卡,选择CSCommTestDlg^,为IDC_MSCOMM1添加控制变量:m_ctrlCom m,这时你可以看一看,在对话框头文件中自动加入了//{{AFX_INCLUDES()#include "mscomm.h" //}}AFX_INCLUDES (这时运行程序,如果有错,那就再从头开始)。 4 .在对话框中添加控件 向主对话框中添加两个编辑框,一个用于接收显示数据ID为 IDC_EDIT_RXDATA另一个用于输入发送数据,ID为IDC_EDIT_TXDAT A再添加一个按钮,功能是按一次就把发送编辑框中的内容发送一次,将其ID设为 IDC_BUTTON_MANUALSEND别忘记了将接收编辑框的Prop erties->Styles 中把Miltiline和Vertical Scroll属性选上,发送编辑框若你想输入多行文字,也可选上Miltiline。

sumifs函数多条件求和实例

s u m i f s函数多条件求和实 例 Prepared on 22 November 2020

sumifs函数多条件求和实例 内容提要:文章首先介绍sumifs函数基本用法,然后以一个综合的实例来剖析sumifs函数的详细深入使用。 第一部分,sumifs函数用法介绍 excel中sumifs函数是2007以后版本新增的多条件求和函数。 sumifs函数的语法是:SUMIFS(求和区域,条件区域1,条件1,[条件区域2,条件2],...) 说明:[]以内的条件区域2、条件2为可选参数。最多允许127个区域/条件对。 第二部分,sumifs函数实例介绍 项目一:客户A的销售额 =SUMIFS(C2:C10,A2:A10,A2) 项目二:客户A的1月份销售额 =SUMIFS(C2:C10,A2:A10,A2,B2:B10,B2) 项目三:客户A的1月份和3月份销售额 =SUM(SUMIFS(C2:C10,A2:A10,A2,B2:B10,{1,3})) 项目四:客户A和C的销售额 =SUM(SUMIFS(C2:C10,A2:A10,{"A","C"})) 项目五:客户A和C的1月份销售额合计 =SUM(SUMIFS(C2:C10,A2:A10,{"A","C"},B2:B10,B2)) 项目六:客户A的1月份和客户C的3月份销售额合计 =SUM(SUMIFS(C2:C10,A2:A10,{"A","C"},B2:B10,{1,3})) 项目七:客户A和客户C的1月份\3月份\4月份销售额合计 =SUM(SUMIFS(C2:C10,A2:A10,{"A","C"},B2:B10,{1;3;4}))

相关主题
文本预览
相关文档 最新文档